This commit is contained in:
Oleksandr Vyshniakov 2025-11-04 18:18:49 +01:00
parent 499fc49015
commit fd40d81e4f
2 changed files with 17 additions and 1 deletions

View File

@ -29,7 +29,23 @@ struct car* add_car (struct car* first, const char* target) {
}
void print_train (struct car* first) {
if (first == NULL) {
printf("vlak je prazdny!");
return;
}
struct car* actual = first;
int schet = 1;
while (actual !=NULL) {
printf("%d. [%s]", poradie, aktualny->value);
if (aktualny->next != NULL) {
printf("->");
}
aktualny = aktualny->next;
schet++;
}
printf("\n");
}
void cancel_train (struct car* first) {

0
du4/train.h Normal file
View File