There is a part of the code:
struct St { char Name[30]; int math; int phys; int inf; int chem; int dateOfBirth; int group; double ball; } Students; void addStudent() { f1 = fopen("list.txt", "w"); cout << "Enter the Name of student: "; gets_s(Students.Name, 29); cout << "Enter the chemistry ball: "; scanf("%d", &Students.chem); } The task is to open the file, read the student's name and score from the console, and then add it to the open file. However, when performing it is impossible to enter a name, because immediately after "Enter the Name of student:" displays "Enter the chemistry ball:" thereby not allowing to enter a string. What is the problem?