du2 - 1
This commit is contained in:
parent
636ccf6c1c
commit
497be19a0e
29
du2/program.c
Normal file
29
du2/program.c
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#define LINESIZE 100
|
||||||
|
#define MAXITEMS 100
|
||||||
|
|
||||||
|
// struktura pre polozku jed. listka
|
||||||
|
struct pizza {
|
||||||
|
char name[LINESIZE];
|
||||||
|
float price;
|
||||||
|
};
|
||||||
|
|
||||||
|
int read_pizza(struct pizza *item) {
|
||||||
|
char line1[LINESIZE];
|
||||||
|
char line2[LINESIZE];
|
||||||
|
|
||||||
|
if (!fgets(line1, LINESIZE, stdin)) return 0;
|
||||||
|
line1[strcspn(line1, "\n")] = 0;
|
||||||
|
|
||||||
|
float value;
|
||||||
|
if (sscanf(line2, "%f", &value) != 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user