refresh
This commit is contained in:
parent
206dd3e427
commit
b0fb774e70
@ -46,10 +46,14 @@ int main() {
|
||||
char name[namemax];
|
||||
|
||||
if (sscanf(buffer, "%d %99[^\n]", &golosa, name) != 2 || golosa <= 0) {
|
||||
continue; // Пропускаем ошибочную строку
|
||||
continue;
|
||||
}
|
||||
|
||||
if (find_student(students, count, name) == -1) {
|
||||
int index = find_student(students, count, name);
|
||||
|
||||
if (index != -1) {
|
||||
students[index].golosa += golosa;
|
||||
} else {
|
||||
strcpy(students[count].name, name);
|
||||
students[count].golosa = golosa;
|
||||
count++;
|
||||
@ -71,3 +75,8 @@ int main() {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
BIN
du4/program.exe
BIN
du4/program.exe
Binary file not shown.
Loading…
Reference in New Issue
Block a user