usaa24/cv4/main.c

28 lines
776 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "a_train.h"
#include <stdio.h>
int main() {
struct car* train = NULL;
// Добавляем вагоны
train = add_car(train, "Bratislava");
train = add_car(train, "Vienna");
train = add_car(train, "Budapest");
// Выводим поезд
printf("Поезд перед удалением:\n");
print_train(train);
// Удаляем вагоны с целевой станцией "Vienna"
train = clear_train(train, "Vienna");
// Выводим поезд после удаления
printf("\nПоезд после удаления вагонов со станцией 'Vienna':\n");
print_train(train);
// Очищаем память
cancel_train(train);
return 0;
}