Что будет выведено на экран в результате выполнения фрагмента программы
цел a=5, b=3
вывод a, '=Z(', b, ')'
284
319
Ответы на вопрос:
#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;
}
Популярно: Информатика
-
amaliyaazlzova27.09.2020 22:00
-
5nelli02.08.2022 18:10
-
seniorALFEROV04.06.2023 22:15
-
Топтоппатимейкер06.01.2023 22:37
-
trohy7112.01.2023 05:50
-
Гогого1110.10.2021 08:26
-
блаблаблатруляля12.12.2022 21:48
-
viktorpadalck20.07.2020 22:51
-
autegenova28.02.2023 01:29
-
azharabikenova11.10.2022 19:20