program2
This commit is contained in:
parent
1c5e40c6cf
commit
d3aee7f119
@ -62,18 +62,20 @@ char hacker_script(char c){
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
|
|
||||||
|
printf("Zadaj hladanu surovinu:");
|
||||||
char key[LINESIZE];
|
char key[LINESIZE];
|
||||||
memset(key,0,LINESIZE);
|
memset(key,0,LINESIZE);
|
||||||
char* r = fgets(key,LINESIZE,stdin);
|
char* r = fgets(key,LINESIZE,stdin);
|
||||||
|
|
||||||
|
printf("Zadaj jedalny listok:");
|
||||||
struct pizza jedalny_listok[100];
|
struct pizza jedalny_listok[100];
|
||||||
struct pizza pomocny[100];
|
struct pizza pomocny[100];
|
||||||
memset(pomocny, 0, sizeof(struct pizza)*100);
|
memset(pomocny, 0, sizeof(struct pizza)*100);
|
||||||
memset(jedalny_listok, 0,sizeof(struct pizza)*100);
|
memset(jedalny_listok, 0,sizeof(struct pizza)*100);
|
||||||
struct pizza item;
|
struct pizza item;
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
|
|
||||||
|
|
||||||
while(read_pizza(&item)){
|
while(read_pizza(&item)){
|
||||||
strcpy(jedalny_listok[counter].name, item.name);
|
strcpy(jedalny_listok[counter].name, item.name);
|
||||||
@ -91,7 +93,7 @@ int main(){
|
|||||||
if(search_string(pomocny[i].name, key) != -1){
|
if(search_string(pomocny[i].name, key) != -1){
|
||||||
printf("%s", jedalny_listok[i].name);
|
printf("%s", jedalny_listok[i].name);
|
||||||
printf("%.2f\n", jedalny_listok[i].prize);
|
printf("%.2f\n", jedalny_listok[i].prize);
|
||||||
printf("Nacitano %d poloziek\n", counter);
|
printf("Nacitano %d poloziek.\n", counter);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user