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

This commit is contained in:
Yevhen Kozirovskyi 2024-10-01 22:05:42 +00:00
parent 48b5aeb747
commit d36ee9900c

View File

@ -28,10 +28,9 @@ int main() {
char dishes[MAX_DISHES][2][MAX_NAME_LEN]; char dishes[MAX_DISHES][2][MAX_NAME_LEN];
int count = 0; int count = 0;
printf("Zadaj hladanu surovinu: "); printf("Zadaj hladanu surovinu:");
if (fgets(ingredient, MAX_NAME_LEN, stdin) == NULL) { if (fgets(ingredient, MAX_NAME_LEN, stdin) == NULL) {
fprintf(stderr, "Ошибка чтения ингредиента.\n"); return 0; // Обработка ошибки
return 1; // Обработка ошибки
} }
ingredient[strcspn(ingredient, "\n")] = '\0'; ingredient[strcspn(ingredient, "\n")] = '\0';