Přidat du5/program.c

This commit is contained in:
Tomáš Vlček 2026-04-13 20:54:01 +00:00
parent 54dca12376
commit 9d8f5a5cea

32
du5/program.c Normal file
View File

@ -0,0 +1,32 @@
#include <stdio.h>
#include <stdlib.h>
#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;
}