diff --git a/cv5/a_train.c b/cv5/a_train.c index ae2b161..da442db 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -4,13 +4,11 @@ #include -/*int main(void){ +int main(void){ printf("Zadajte zoznam cieľových staníc a počet cestujúcich.\n"); printf("Zoznam zakončite prázdnym riadkom.\n"); - - add_car; return 0; -}*/ +} struct car* add_car(struct car* first,const char* target) { struct car* newcar = calloc(1,sizeof(struct car)); @@ -36,13 +34,13 @@ void print_train(struct car* first) { void cancel_train(struct car* first) { if(first!=NULL){ - struct car* temp= first; - struct car* next; - while(temp!=NULL){ - next=temp->next; - free(temp); - temp=next; - } + struct car* temp=first; + struct car* next; + while(temp!=NULL){ + next=temp->next; + free(temp); + temp=next; + } first=NULL; } } diff --git a/cv5/train.exe b/cv5/train.exe new file mode 100644 index 0000000..67b01e1 Binary files /dev/null and b/cv5/train.exe differ