evcamels

timp_4-18

Dec 23rd, 2021
816
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4. int main(){
  5.     vector <int> a;
  6.     int n, count = 1;
  7.     cout << "Введите количество элементов массива: ";
  8.     cin >> n;
  9.     for(int i=0;i<n;i++){
  10.         int temp;
  11.         cin >> temp;
  12.         if(temp > 0 && temp < 10){
  13.             count*=temp;
  14.         }
  15.         a.push_back(temp);
  16.     }
  17.     cout << "Полученный массив: ";
  18.     for(int i=0;i<n;i++){
  19.         cout << a[i] << " ";
  20.     }
  21.     cout << "Произвездение чисел попадающих в интервал [0;10]: " << count << endl;
  22.     return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment