Advertisement
STANAANDREY

5/65

Nov 18th, 2019
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. typedef struct
  5. {
  6.     int l, an;
  7. } SPORTIV;
  8.  
  9. int main()
  10. {
  11.     SPORTIV sp[100];
  12.     int n;
  13.     cin >> n;
  14.     for (int i = 0; i < n; i++)
  15.         cin >> sp[i].l >> sp[i].an;
  16.  
  17.     int med = 0;
  18.     for (int i = 0; i < n; i++)
  19.         med += sp[i].l + 12 * (sp[i].an - 1);
  20.  
  21.     med /= n;
  22.     cout << "medie:" << med << endl << "Lista elevi:" << endl;
  23.  
  24.     for (int i = 0; i < n; i++)
  25.     {
  26.         int v = sp[i].l + 12 * (sp[i].an - 1);
  27.         if (v < med)
  28.             cout << sp[i].l << ' ' << sp[i].an << endl;
  29.     }
  30.  
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement