Přidat du5/program.c
This commit is contained in:
parent
54dca12376
commit
9d8f5a5cea
32
du5/program.c
Normal file
32
du5/program.c
Normal 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;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user