From e1c4306436b16f5580f1d4d7da9aa80b77197407 Mon Sep 17 00:00:00 2001 From: Marat Izmailov Date: Thu, 17 Oct 2024 17:49:18 +0000 Subject: [PATCH] Update cv4/a_train.c --- cv4/a_train.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/cv4/a_train.c b/cv4/a_train.c index 3102ea1..46997dc 100644 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -5,14 +5,14 @@ struct car* add_car(struct car* first, const char* target) { - struct car* newcar = (struct car*)calloc(1, sizeof(struct car)); + struct car* newcar = (struct car*)calloc(1, sizeof(struct car)); if (newcar == NULL) { - printf("Ошибка: не удалось выделить память.\n"); + printf("Chyba: nepodarilo sa alokovať pamäť.\n"); exit(1); } - strcpy(newcar->value, target); - newcar->next = NULL; + strcpy(newcar->value, target); + newcar->next = NULL; if (first == NULL) { return newcar; @@ -32,12 +32,12 @@ void print_train(struct car* first) { struct car* current = first; if (current == NULL) { - printf("Поезд пуст.\n"); + printf("Vlak je prázdny.\n"); return; } while (current != NULL) { - printf("%s\n", current->value); + printf("%s\n", current->value); current = current->next; } } @@ -74,7 +74,6 @@ struct car* clear_train(struct car* first, const char* target) { current = current->next; } } - + return first; } -