This commit is contained in:
Džubara 2024-03-22 00:15:09 +01:00
parent 0d6e6aadd2
commit 67846c51bd

View File

@ -32,7 +32,7 @@ int main() {
char name[SIZE]; char name[SIZE];
int votes; int votes;
printf("Enter votes for 'Student of the Year' contest (or 'q' to quit):\n"); //printf("Enter votes for 'Student of the Year' contest (or 'q' to quit):\n");
while (fgets(line, SIZE, stdin) != NULL) { while (fgets(line, SIZE, stdin) != NULL) {
// Kontrola ukončenia vstupu // Kontrola ukončenia vstupu
@ -42,7 +42,7 @@ int main() {
// Načítanie počtu hlasov a mena zo vstupu // Načítanie počtu hlasov a mena zo vstupu
if (sscanf(line, "%d %[^\n]", &votes, name) != 2) { if (sscanf(line, "%d %[^\n]", &votes, name) != 2) {
printf("Invalid input format. Exiting.\n"); //printf("Invalid input format. Exiting.\n");
return 1; return 1;
} }