2
This commit is contained in:
parent
0d816c08c6
commit
a91a973b6c
@ -35,31 +35,3 @@ int contains_substring(char *food_name, char *ingredient) {
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
|
||||||
char ingredient[100];
|
|
||||||
char food_name[100];
|
|
||||||
char price[20];
|
|
||||||
int count = 0;
|
|
||||||
|
|
||||||
printf("Zadaj hladanu surovinu: ");
|
|
||||||
scanf("%s", ingredient);
|
|
||||||
|
|
||||||
printf("Zadaj jedalny listok:\n");
|
|
||||||
while (scanf("%s", food_name) != EOF) {
|
|
||||||
if (scanf("%s", price) == EOF) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (contains_substring(food_name, ingredient)) {
|
|
||||||
printf("%s\n%s\n", food_name, price);
|
|
||||||
}
|
|
||||||
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
printf("Nacitanych %d poloziek.\n", count);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user