From a234cf28edbf05457237fe448f219e4ea32ae4d6 Mon Sep 17 00:00:00 2001 From: Artem Horbunov Date: Wed, 8 Apr 2020 08:55:02 +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 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/du5/program.c b/du5/program.c index 6a4dddc..c6e960d 100644 --- a/du5/program.c +++ b/du5/program.c @@ -14,10 +14,15 @@ int main(){ ungetc(tmpCh, stdin); scanf("%d %[^\n]", &score[pos], name[pos]); + + tmpCh = getc(stdin); + if(tmpCh == EOF) break; + ungetc(tmpCh, stdin); + scanf("%*c"); pos++; - if(strcmp(name[pos - 1], cmpStr1) == 0) break; - if(strcmp(name[pos - 1], cmpStr2) == 0) break; + //if(strcmp(name[pos - 1], cmpStr1) == 0) break; + //if(strcmp(name[pos - 1], cmpStr2) == 0) break; tmpCh = getc(stdin); if(tmpCh == '\n') break;