From 5d515e90807ff0b8d729b28e98b550bde7527899 Mon Sep 17 00:00:00 2001 From: Bohdan Yanchyk Date: Thu, 9 Apr 2020 20:24:07 +0000 Subject: [PATCH] =?UTF-8?q?Aktualizovat=20=E2=80=9Edu5/program.c=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du5/program.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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