Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- typedef struct
- {
- int l, an;
- } SPORTIV;
- int main()
- {
- SPORTIV sp[100];
- int n;
- cin >> n;
- for (int i = 0; i < n; i++)
- cin >> sp[i].l >> sp[i].an;
- int med = 0;
- for (int i = 0; i < n; i++)
- med += sp[i].l + 12 * (sp[i].an - 1);
- med /= n;
- cout << "medie:" << med << endl << "Lista elevi:" << endl;
- for (int i = 0; i < n; i++)
- {
- int v = sp[i].l + 12 * (sp[i].an - 1);
- if (v < med)
- cout << sp[i].l << ' ' << sp[i].an << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement