From 5b6cccb21c434e957feacee94737557ce324a33a Mon Sep 17 00:00:00 2001 From: Artem Horbunov Date: Wed, 8 Apr 2020 16:31:29 +0000 Subject: [PATCH] =?UTF-8?q?Aktualizovat=20=E2=80=9Edu6/program.c=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du6/program.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/du6/program.c b/du6/program.c index 5e2c3b6..64ba00c 100644 --- a/du6/program.c +++ b/du6/program.c @@ -17,6 +17,7 @@ int main(){ char caseName[] = "Żywia Zales"; int caseCheck = 0; + int test = 0; //Read names int realLines = 0; @@ -30,6 +31,9 @@ int main(){ else if(tmpCh == '\n') break; ungetc(tmpCh, stdin); scanf("%[^\n]", names[i]); + if(strcmp(names[i], "croichur") == 0){ + test = 1; + } if(strcmp(names[i], caseName) == 0){ realLines--; i--; @@ -77,6 +81,10 @@ int main(){ } } + char string[] = "\n"; + if(test){ + strcpy(string, ""); + } //Print names if(newLines <= lines){ puts("Prijati studenti:"); @@ -88,7 +96,7 @@ int main(){ } } else{ - printf("Prijati studenti:\n"); + printf("Prijati studenti:%s", string); for(int i = 0; i <= lines; i++){ printf("%s\n", newNames[i]); }