This commit is contained in:
Andrii Hermaniuk 2022-04-07 17:02:24 +02:00
parent 2222e464b7
commit f1b0eb3770

View File

@ -33,7 +33,7 @@ int main(){
if (value == 0&&line[0]=='\n'){ if (value == 0&&line[0]=='\n'){
// Premena sa nepodarila // Premena sa nepodarila
break; break;
}else if((value==0&&line[0]!='\n'&&size==0)||(size==0&&line==EOF)){ }else if((value==0&&line[0]!='\n'&&size==0)){
printf("Nepodarilo nacitat nic\n"); printf("Nepodarilo nacitat nic\n");
return 0; return 0;
} }
@ -56,6 +56,10 @@ int main(){
qsort(databaza, size, sizeof(struct student), compare); qsort(databaza, size, sizeof(struct student), compare);
} }
} }
if(sizr==0){
printf("Nepodarilo nacitat nic\n");
return 0;
}
printf("Vysledky:\n"); printf("Vysledky:\n");
for(int idx=0;databaza[idx].name[0]!='\0';idx++) for(int idx=0;databaza[idx].name[0]!='\0';idx++)
printf("%d %s", databaza[idx].votes, databaza[idx].name); printf("%d %s", databaza[idx].votes, databaza[idx].name);