Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Russian");
- int n = 0, m = 0, Y[100];
- cout << "Рандомный массив, на 100 элементов:" << endl;
- for (int i = 0; i <= 100; i++)
- {
- Y[i] = rand() % 10;
- cout << Y[i];
- if (Y[i] == 0)
- n++;
- if (Y[i] == 0)
- m = m*Y[i];
- }
- cout <<endl<< "Введено нулевых элементов:" << n << "\n";
- cout << "Произведение элементов:" << m << "\n";
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement