diff --git a/du5/program.c b/du5/program.c index 1f506ad..e65e372 100644 --- a/du5/program.c +++ b/du5/program.c @@ -36,7 +36,7 @@ int main(){ if(str[0]=='\n'){ break; } - sscanf(str,"%d %s",&score,name); + sscanf(str,"%d %[^\t\n]",&score,name); PersonList[c].score = score; strcpy(PersonList[c].name ,name); c++; @@ -45,10 +45,11 @@ int main(){ if(c>2){ qsort(PersonList,c,sizeof(struct person),comp); } - + int res_strcmp=0; int idex = 0; for(int i =0;i