Aktualizovat „du5/program.c“

This commit is contained in:
Bohdan Yanchyk 2020-04-09 19:36:08 +00:00
parent 96a7241751
commit d72315dc5d

View File

@ -50,10 +50,13 @@ int main(){
int flag=0; int flag=0;
printf("Vysledok\n"); printf("Vysledok\n");
for(int i =0;i<c;i++){ for(int i =0;i<c;i++){
if(strcmp(PersonList[i]->name,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); printf("%d %s\n",PersonList[i].score,PersonList[i].name);
flag=1;
} }
else{
flag=0;
}
} }
free(PersonList); free(PersonList);
return 0; return 0;