#include <iostream>
#include <ctime>
using namespace std;
void main()
{
srand(time(NULL));
const int size = 12;
int arr[size];
int c = 0;
for (int i = 1; i <= size; i++)
arr[i] = rand() % 80 + (-40);
if (arr[i] % 2 != 0)
continue;
c += arr[i];
}
cout << c << endl;
system("pause");
#include <iostream>
#include <ctime>
using namespace std;
void main()
{
srand(time(NULL));
const int size = 12;
int arr[size];
int c = 0;
for (int i = 1; i <= size; i++)
{
arr[i] = rand() % 80 + (-40);
if (arr[i] % 2 != 0)
continue;
c += arr[i];
}
cout << c << endl;
system("pause");
}