Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- struct Baze
- {
- char name[15];
- int ball[5];
- int itog;
- };
- int main()
- {
- setlocale(LC_ALL, "rus");
- int n, average;
- cout << "Введите количество студентов... "; cin >> n;
- cout << endl; cout << "Введите Средний балл... "; cin >> average;
- cout << endl;
- Baze* baze = new Baze[n];
- for (int i = 0; i < n; i++)
- {
- cout << "Введите имя студента... "; cin >> baze[i].name;
- cout << "введите балл... ";
- for (int j = 0; j < 5; j++)
- {
- cin >> baze[i].ball[j]; cout << " ";
- }
- baze[i].itog = 0;
- cout << endl;
- }
- for (int i = 0; i < n; i++)
- {
- for (int j = 0; j < 5; j++)
- {
- baze[i].itog += baze[i].ball[j];
- }
- if (((baze[i].itog) / 5) > average) { cout << baze[i].name << " > " << average << endl; }
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement