From 9d8f5a5cea3b328dd37784c4a2d1864439b75b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Vl=C4=8Dek?= Date: Mon, 13 Apr 2026 20:54:01 +0000 Subject: [PATCH] =?UTF-8?q?P=C5=99idat=20du5/program.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du5/program.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 du5/program.c diff --git a/du5/program.c b/du5/program.c new file mode 100644 index 0000000..e3a9c65 --- /dev/null +++ b/du5/program.c @@ -0,0 +1,32 @@ +#include +#include + +#define SIZE 128 + +int main() +{ + char line[SIZE]; + char answer[SIZE]; + + + while (1) + { + char* p = fgets(line, SIZE, stdin); + if (p == NULL) + { + break; + } + else if (p == '*') + { + //precita a ulozi odpoved + sscanf(answer, "%s [^\n]", &answer); + } + else if (p == 'n') + { + printf("koniec\n"); + exit(0); + } + } + + return 0; +} \ No newline at end of file