М
Молодежь
К
Компьютеры-и-электроника
Д
Дом-и-сад
С
Стиль-и-уход-за-собой
П
Праздники-и-традиции
Т
Транспорт
П
Путешествия
С
Семейная-жизнь
Ф
Философия-и-религия
Б
Без категории
М
Мир-работы
Х
Хобби-и-рукоделие
И
Искусство-и-развлечения
В
Взаимоотношения
З
Здоровье
К
Кулинария-и-гостеприимство
Ф
Финансы-и-бизнес
П
Питомцы-и-животные
О
Образование
О
Образование-и-коммуникации

Mcafee.com/activate is a complete technical guide where you can get easy technical guidelines to perform the instructions needed for a successful mcafee activate. first of all, you need to login in into and enter your 25 digit activation code and go for “get protected” button. you need to follow all the instructions displayed on this website and get installed mcafee antivirus on pc in the proper ways. by doing it, you can get complete installation mcafee antivirus on computer system. if you’re facing any issues in the procedure, online antivirus experts are available 24/7 to provide quick support.

👇
Открыть все ответы
Ответ:
Grechk
Grechk
08.06.2022

#include <iostream>

int main() {

const int SIZE = 10;

bool isSence = false;

int sum = 0;

int count = 0;

int arr[SIZE];

for (int i = 0; i < SIZE; i++)

{

 arr[i] = rand() % 20 - 10; // "рандомно" заполняем массив от -10 до 10

 std::cout << arr[i] << "\t"; // выводим массив в консоль

 if (arr[i] >= 0)

  isSence = true;

}

for (int i = 0; i < SIZE; i++)

{

 if ((isSence) && (arr[i] > 0))

  sum += arr[i]; //sum = sum + arr[i];

  count++;

}

if (isSence)

 std::cout << "\nсреднее арифметическое положительных чисел = " << double(sum) / count << std::endl; // явное приведение типов

else

 std::cout << "\nВ массиве нету положительных чисел или нету нулей и/или отрицательных чисел" << std::endl;

return 0;

}

4,4(24 оценок)
Ответ:
krasorka
krasorka
08.06.2022
Только программа, блок-схему не знаю
#include <iostream>
#include <iomanip>
#include <vector>
#include <ctime>
int main()
{
    using namespace std;

    const int n = 5;
    int A[n][n];
    int D[n][n];
    vector<int> B(n);
    vector<int> C(n);
    vector<int> S(n);   //результирующий вектор

    //как-нибудь заполняем исходные матрицы и вектора
    srand(time(0));
    for (int i = 0; i < n; ++i)
    {
        for (int j = 0; j < n; ++j)
        {
            A[i][j] = rand() % (n * n) - n * n / 2;
            D[i][j] = rand() % (n * n) - n * 2;
        }
        B[i] = rand() % (n * n) - n;
        C[i] = rand() % (n * n) - n * n + n;
    }

    //выведем исходные данные на экран
    cout << "matrix A:\n";
    for (int i = 0; i < n; ++i)
    {
        for (int j = 0; j < n; ++j)
            cout << setw(5) << A[i][j];
        cout << endl;
    }

    cout << "\nmatrix D:\n";
    for (int i = 0; i < n; ++i)
    {
        for (int j = 0; j < n; ++j)
            cout << setw(5) << D[i][j];
        cout << endl;
    }

    cout << "\nvector B:\n";
    for (int i = 0; i < n; ++i)
        cout << setw(5) << B[i] << endl;

    cout << "\nvector C:\n";
    for (int i = 0; i < n; ++i)
        cout << setw(5) << C[i] << endl;

    //вычислим требуемое
    for (int i = 0; i < n; ++i)
    {
        S[i] = 0;
        for (int j = 0; j < n; ++j)
            S[i] += D[i][j] * C[j];
        S[i] += 3 * B[i];
    }

    //выведем результат на экран
    cout << "\nvector S = D * C + 3 * B:\n";
    for (int i = 0; i < n; ++i)
        cout << setw(5) << S[i] << endl;

    return 0;
}
4,7(45 оценок)
Новые ответы от MOGZ: Информатика
Полный доступ к MOGZ
Живи умнее Безлимитный доступ к MOGZ Оформи подписку
logo
Вход Регистрация
Что ты хочешь узнать?
Спроси Mozg
Открыть лучший ответ