Есть ответ 👍

Что будет выведено на экран в результате выполнения фрагмента программы

цел a=5, b=3

вывод a, '=Z(', b, ')'

284
319
Посмотреть ответы 1

Ответы на вопрос:


#include <iostream>

#include <ctime>

using namespace std;

int randInt(int min, int max){

return min + (rand() % (max - min + 1));

}

int main(int argc, char *argv[]){

const int SIZE = 10;

int a[SIZE];

 

srand(time(0));

 

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

 a[i] = randInt(-10, 10);

 cout << a[i] << ' ';

}

cout << endl;

cout << endl;

 

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

 if (a[i] % 2 != 0)

  cout << a[i] << ' ';

}

cout << endl;

 

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

 if (a[i] % 2 == 0)

  cout << a[i] << ' ';

}

cout << endl;

 

system("pause");

return 0;

}

Популярно: Информатика