Обновить cv1/program.c

This commit is contained in:
Yevhen Kozirovskyi 2024-10-03 11:09:42 +00:00
parent 432668568e
commit 3b299071d6

View File

@ -33,16 +33,18 @@ int main() {
decode(slovo);
printf("Zadaj jedalny listok:\n");
while (1) {
if (fgets(dish_name, MAX_LENGTH, stdin) == NULL || strcmp(dish_name, "\n") == 0) {
break;
}
dish_name[strcspn(dish_name, "\n")] = 0;
// Read the price as a float
if (scanf("%f", &price[count]) != 1) {
break;
}
// Clear the newline character left in the input buffer
while (getchar() != '\n');
char normal_dish[MAX_LENGTH];
strcpy(normal_dish, dish_name);
decode(normal_dish);