diff --git a/du5/program.c b/du5/program.c index c9a56d9..6d45f9a 100644 --- a/du5/program.c +++ b/du5/program.c @@ -50,10 +50,13 @@ int main(){ int flag=0; printf("Vysledok\n"); for(int i =0;iname,PersonList[i+1]->name)!=0||flag==0){ + if((strcmp(PersonList[i].name,PersonList[i+1].name)==0||strcmp(PersonList[i].name,PersonList[i+1].name)!=0)&&flag==0){ printf("%d %s\n",PersonList[i].score,PersonList[i].name); + flag=1; } - + else{ + flag=0; + } } free(PersonList); return 0;