This commit is contained in:
Kamil Gejdoš 2026-03-11 13:27:41 +00:00
parent b3e37838ff
commit 4a873fe7e4

View File

@ -34,10 +34,6 @@ int main() {
char name[SIZE]; char name[SIZE];
int velkost_zoznamu = 0; //pocet studentov int velkost_zoznamu = 0; //pocet studentov
if ((fgets (vstup, SIZE, stdin) != NULL) && (sscanf(vstup, "%d %[^\n]", &hlasy, name) != 2)) {
printf("Nepodarilo sa nacitat nic\n");
return 0;
}
while (fgets (vstup, SIZE, stdin) != NULL) { while (fgets (vstup, SIZE, stdin) != NULL) {
//citat input, kontrola ci existuje, pridat hlasy existujucemu zaznamu //citat input, kontrola ci existuje, pridat hlasy existujucemu zaznamu
if (sscanf(vstup, "%d %[^\n]", &hlasy, name) != 2) { if (sscanf(vstup, "%d %[^\n]", &hlasy, name) != 2) {