#include <iostream>
using namespace std;
#define n 10
int main()
{
int counter = 0;
int a[n];
for(int i=0; i<n; i++)
a[i] = -10000 + rand() % 20000;
if(a[i] % 2 == 0 && a[i]>=10 && a[i]<=99 && a[i] > 0)
counter = counter + 1;
}
cout<< counter<<endl;
return 0;
Объяснение:
#include <iostream>
using namespace std;
#define n 10
int main()
{
int counter = 0;
int a[n];
for(int i=0; i<n; i++)
{
a[i] = -10000 + rand() % 20000;
if(a[i] % 2 == 0 && a[i]>=10 && a[i]<=99 && a[i] > 0)
counter = counter + 1;
}
cout<< counter<<endl;
return 0;
}
Объяснение: