aa
This commit is contained in:
parent
954495da68
commit
0833dd70ed
@ -5,7 +5,7 @@
|
||||
|
||||
#define LINESIZE 100
|
||||
#define LINE_SIZE 100
|
||||
|
||||
#define POCET_JEDAL 100
|
||||
struct pizza {
|
||||
float prize;
|
||||
char name[LINESIZE];
|
||||
@ -14,20 +14,22 @@ struct pizza {
|
||||
int read_pizza(struct pizza* item);
|
||||
char hacker_script(char c);
|
||||
int main(){
|
||||
int POCET_JEDAL=0;
|
||||
|
||||
struct pizza jedalny_listok[POCET_JEDAL];
|
||||
memset(jedalny_listok, 0,sizeof(struct pizza)*POCET_JEDAL);
|
||||
|
||||
char line[LINE_SIZE];
|
||||
memset(line,0,LINE_SIZE);
|
||||
printf("Zadaj hladanu surovinu:\n");
|
||||
char* r = fgets(line,LINE_SIZE,stdin);
|
||||
if(r != NULL && line[1] != 0){
|
||||
printf("Zadaj jedalny listok\n");
|
||||
struct pizza item;
|
||||
int counter = 1;
|
||||
while(read_pizza(&item)){
|
||||
strcpy(jedalny_listok[counter-1].name, item.name);
|
||||
jedalny_listok[counter-1].prize=item.prize;
|
||||
counter += 1;
|
||||
printf("%s",item.name);
|
||||
printf("%.2f\n",item.prize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
BIN
cv1/program.exe
BIN
cv1/program.exe
Binary file not shown.
Loading…
Reference in New Issue
Block a user