This commit is contained in:
Bohdan Kapliuk 2024-09-30 20:34:13 +03:00
parent b62aa24115
commit 10398ec2b6

View File

@ -1,5 +1,6 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define LINESIZE 100
struct pizza {
@ -51,23 +52,19 @@ int main(){
}
}
}
int odpoved = -1;
for(int i = 0; i <= count && odpoved == -1;i++){
for(int j = 0; j <= strlen(menu[i].name);j++){
for(int i = 0; i <= count;i++){
int y = 0;
for(int x = 0; x <= strlen(surovina);x++){
if(surovina[x] != menu[i].name[j]){
if(surovina[x] != menu[i].name[x]){
break;
}
odpoved = i;
y = 1;
}
if(y == 1){
printf("%s\n", menu1[i].name);
float number = strtof(menu1[i].price, NULL);
printf("%.2f\n", number);
}
}
}
if(odpoved == -1){
printf("chyba");
}
else{
printf("%s\n", menu1[odpoved].name);
printf("%s\n", menu1[odpoved].price);
}
printf("Nacitanych %d poloziek.\n", count);
return 0;