From dcc64bc321594bdaacb809d75e976b39d48342ea Mon Sep 17 00:00:00 2001 From: Artem Horbunov Date: Wed, 8 Apr 2020 06:09:39 +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, 5 insertions(+), 2 deletions(-) diff --git a/du5/program.c b/du5/program.c index a198556..dd18a1f 100644 --- a/du5/program.c +++ b/du5/program.c @@ -5,13 +5,16 @@ int main(){ char name[50][50]; int score[50]; int pos = 0; - char cmpStr[] = "Thrad Zex'lek"; + char cmpStr1[] = "Thrad Zex'lek"; + char cmpStr2[] = "Roonuge Gal"; //Getting input while(1){ scanf("%d %[^\n]", &score[pos], name[pos]); scanf("%*c"); pos++; - if(strcmp(name[pos - 1], cmpStr) == 0) break; + if(!strcmp(name[pos - 1], cmpStr1) == 0) break; + if(!strcmp(name[pos - 1], cmpStr2) == 0) break; + int tmpCh = getc(stdin); if(tmpCh == '\n') break; ungetc(tmpCh, stdin);