Advertisement
Milaj

Untitled

Mar 17th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <math.h>
  4. using namespace std;
  5. int main()
  6. {
  7.     setlocale(LC_ALL, "Russian");
  8.     int n = 0, m = 0, Y[100];
  9.     cout << "Рандомный массив, на 100 элементов:" << endl;
  10.     for (int i = 0; i <= 100; i++)
  11.     {
  12.         Y[i] = rand() % 10;
  13.         cout << Y[i];
  14.         if (Y[i] == 0)
  15.             n++;
  16.         if (Y[i] == 0)
  17.             m = m*Y[i];
  18.     }
  19.     cout <<endl<< "Введено нулевых элементов:" << n << "\n";
  20.     cout << "Произведение элементов:" << m << "\n";
  21.  
  22.     system("pause");
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement