From ce83440de1e93f16a4db03e69140160774afd093 Mon Sep 17 00:00:00 2001 From: Bohdan Yanchyk Date: Thu, 9 Apr 2020 23:59:27 +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 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/du5/program.c b/du5/program.c index 1689693..f495b51 100644 --- a/du5/program.c +++ b/du5/program.c @@ -39,17 +39,14 @@ int main(){ int c =0; char str[100]; while(fgets(str,100,stdin)){ - if(str[0]=='\n'){ - break; - } - sscanf(str,"%d %[^\t\n]",&score,name); - if(isalpha(str[0])!=0){ + if(isalpha(str[0])!=0||str[0]=='\n'){ if(c==0){ printf("Nepodarilo nacitat nic\n"); return 0; } break; } + sscanf(str,"%d %[^\t\n]",&score,name); PersonList[c].score = score; strcpy(PersonList[c].name ,name); c++;