#include "a_train.h" #include #include int main() { char buf[50]; struct car* train = NULL; memset(buf, 0, 50); printf("Zadajte zoznam cieľových staníc.\nZoznam zakončite prázdnym riadkom.\n"); while (fgets(buf, 50, stdin) != NULL) { if(buf[0] == '\n') { break; } buf[strcspn(buf, "\n")] = '\0'; train = add_car(train,buf); } print_train(train); printf("Zadajte stanicu, ktorá sa má vyradiť:\n"); scanf("%s", buf); train = clear_train(train,buf); print_train(train); cancel_train(train); return 0; }