Update cv4/a_train.c

This commit is contained in:
Yurii Yakovenko 2024-10-23 19:37:45 +00:00
parent 64d9d7bfa3
commit 6179afeebe

View File

@ -1,12 +1,8 @@
#include <stdio.h>
#define SIZE 50
#include"a_train.h"
struct car
{
char value[SIZE]; // Cieľová stanica
struct car* next; // Ďaľší záznam, môže byť NULL
};
struct car* add_car(struct car* first,const char* target)
{
@ -94,18 +90,6 @@ struct car* clear_train(struct car* first, const char* target)
return first;
}
int main()
{
struct car* train = NULL;
train = add_car(train,"Presov");
train = add_car(train,"Bratislava");
train = add_car(train,"Levoca");
train = add_car(train,"Spiska Nova Ves");
print_train(train);
clear_train(train,"Levoca");
print_train(train);
cancel_train(train);
return 0;
}