Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. struct Baze
  5. {
  6. char name[15];
  7. int ball[5];
  8. int itog;
  9. };
  10. int main()
  11. {
  12. setlocale(LC_ALL, "rus");
  13. int n, average;
  14. cout << "Введите количество студентов... "; cin >> n;
  15. cout << endl; cout << "Введите Средний балл... "; cin >> average;
  16. cout << endl;
  17. Baze* baze = new Baze[n];
  18. for (int i = 0; i < n; i++)
  19. {
  20. cout << "Введите имя студента... "; cin >> baze[i].name;
  21. cout << "введите балл... ";
  22. for (int j = 0; j < 5; j++)
  23. {
  24. cin >> baze[i].ball[j]; cout << " ";
  25.  
  26. }
  27. baze[i].itog = 0;
  28. cout << endl;
  29. }
  30.  
  31. for (int i = 0; i < n; i++)
  32. {
  33. for (int j = 0; j < 5; j++)
  34. {
  35. baze[i].itog += baze[i].ball[j];
  36.  
  37. }
  38. if (((baze[i].itog) / 5) > average) { cout << baze[i].name << " > " << average << endl; }
  39. }
  40. system("pause");
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement