Advertisement
Guest User

Untitled

a guest
Nov 30th, 2015
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.92 KB | None | 0 0
  1. #include "iostream"
  2. using namespace std;
  3.  
  4. struct student {
  5.     char *familiya;
  6.     int god, kurs;
  7.     int mas[6];
  8. };
  9. struct student s[5];
  10. void main()
  11. {
  12.     setlocale(LC_ALL, "Rus");
  13.     for (int i = 0; i<5; i++)
  14.     {
  15.         cout << "Введите фамилию студента" << endl;
  16.         s[i].familiya = new char[15];
  17.         cin >> s[i].familiya;
  18.         cout << "Введите год рождения студента" << endl;
  19.         cin >> s[i].god;
  20.         cout << "Введите курс, на котором учится студент" << endl;
  21.         cin >> s[i].kurs;
  22.         cout << "Введите 6 оценок студента" << endl;
  23.         for (int j = 0; j<6; j++)
  24.         {
  25.             cin >> s[i].mas[j];
  26.         }
  27.     }
  28. for (int i = 0; i < 5; i++) {
  29.             for (int j = 0; j < 5; j++) {
  30.                 if (s[i].mas[j] == 2)
  31.                     cout << "Неудовлетворительная оценка есть у студента " << s[i].familiya << endl;
  32.             }
  33.         }
  34.     system("pause");
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement