Advertisement
niks32

Untitled

Oct 12th, 2022
787
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.22 KB | None | 0 0
  1. void setDataTest(vector<Student> &currentStudent, int count)
  2. {
  3.     for (int i; i < count; i++)
  4.     {
  5.         currentStudent.push_back(new Student);
  6.     }
  7.    
  8.     strcpy_s(currentStudent[0].name, "1");
  9.     currentStudent[0].group = 1;
  10.     currentStudent[0].score[0] = 5;
  11.     currentStudent[0].score[1] = 5;
  12.     currentStudent[0].score[2] = 5;
  13.     currentStudent[0].score[3] = 5;
  14.     currentStudent[0].score[4] = 5;
  15.     //Средний балл студента  5
  16.  
  17.     strcpy_s(currentStudent[1].name, "2");
  18.     currentStudent[1].group = 2;
  19.     currentStudent[1].score[0] = 1;
  20.     currentStudent[1].score[1] = 1;
  21.     currentStudent[1].score[2] = 2;
  22.     currentStudent[1].score[3] = 1;
  23.     currentStudent[1].score[4] = 2;
  24.     //Средний балл студента 1.4
  25.  
  26.     strcpy_s(currentStudent[2].name, "3");
  27.     currentStudent[2].group = 3;
  28.     currentStudent[2].score[0] = 4;
  29.     currentStudent[2].score[1] = 4;
  30.     currentStudent[2].score[2] = 5;
  31.     currentStudent[2].score[3] = 4;
  32.     currentStudent[2].score[4] = 5;
  33.     //Средний балл студента 4.4
  34. }
  35.  
  36. int main()
  37. {
  38.     setlocale(LC_ALL, "Rus");
  39.     int countOfStudent = 3;
  40.     vector<Student> currentStudents;
  41.  
  42.     setDataTest(currentStudents, countOfStudent);
  43.     cout << "Welcome to Online IDE!! Happy Coding :)";
  44.     return 0;
  45. }
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement