#include "stdafx.h"#include <iostream>#include<ctime>using namespace std;int main(){ setlocale(LC_ALL, "ru"); srand(time(NULL)); const int SIZE = 11; int arr[SIZE]; const int SIZE2 = 1; int arr2[SIZE2]{}; int arr3[SIZE2]{}; for (int i = 0,j=0,d=0; i < SIZE; i++) { arr[i] = rand() % 51-25; if (arr[i] < 0) { arr2[j] = arr2[j] + arr[i]; } if (arr[i] > 0) { arr3[d]= arr3[d]+ arr[i]; } if (i == 10) { cout << "Сумма отрицательных элементов массива = " << arr2[j] << endl; cout << "Сумма положительных элементов массива = " << arr3[d] << endl; } } system("pause");return 0;}