skuska spravnosti
This commit is contained in:
parent
0660920523
commit
5302d5ce9c
31
cv2/program.c
Normal file
31
cv2/program.c
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#define LINESIZE 100
|
||||||
|
|
||||||
|
struct Pizza {
|
||||||
|
char name[LINESIZE];
|
||||||
|
float prize;
|
||||||
|
};
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
char line[LINESIZE];
|
||||||
|
memset(line, 0, LINESIZE);
|
||||||
|
char name[LINESIZE];
|
||||||
|
struct Pizza jedalny_listok[LINESIZE];
|
||||||
|
memset(jedalny_listok, 0, sizeof(struct Pizza) * LINESIZE);
|
||||||
|
size_t velkost;
|
||||||
|
while (fgets(line, LINESIZE, stdin)) {
|
||||||
|
velkost = strlen(line);
|
||||||
|
if (velkost == 1 && line[velkost - 1] == '\n') {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
strcpy(jedalny_listok[0].name, line);
|
||||||
|
printf("%s\n", jedalny_listok[0].name);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user