Advertisement
ULK

Лабораторная №9 (11.68)

ULK
Dec 4th, 2022
541
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {  
  7.     int Hight[22];
  8.     int r;
  9.     int i = 0;
  10.     int amount = 0;
  11.  
  12.     cout << "Enter the r number: " << endl;
  13.     cin >> r;
  14.  
  15.     cout << "Enter the hight of the students: " << endl;
  16.     for (i = 0; i < 22; i++) {
  17.         cin >> Hight[i];
  18.     }
  19.  
  20.     for (i = 0; i < 22; i++) {
  21.         if (Hight[i]>r) {
  22.             amount++;
  23.         }
  24.     }
  25.  
  26.     cout << "Amount of students higher than _r_ is: " << amount;
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement