Update du4/program.c
This commit is contained in:
parent
7dfcb3c9db
commit
36c2dd5a16
@ -49,7 +49,8 @@ int main() {
|
|||||||
int has_data = 0;
|
int has_data = 0;
|
||||||
|
|
||||||
while (fgets(line, sizeof(line), stdin)) {
|
while (fgets(line, sizeof(line), stdin)) {
|
||||||
if (sscanf(line, "%d %99[^"]", &votes, name) != 2 || votes < 0) {
|
if (sscanf(line, "%d %[^
|
||||||
|
]", &votes, name) != 2 || votes < 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Student *student = find_or_add(name);
|
Student *student = find_or_add(name);
|
||||||
@ -72,4 +73,3 @@ int main() {
|
|||||||
free_memory();
|
free_memory();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user