train2
This commit is contained in:
parent
20fc5fc559
commit
a3c825715d
@ -31,20 +31,20 @@ void print_train(struct car* first) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cancel_train(struct car* first) {
|
void cancel_train(struct car* first, int val) {
|
||||||
struct car* this;
|
|
||||||
if(first == NULL){
|
if(first == NULL){
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
else{
|
else if(first->next == NULL){
|
||||||
|
struct car* this;
|
||||||
this = first;
|
this = first;
|
||||||
first = this->next;
|
first = this->next;
|
||||||
free(this);
|
free(this);
|
||||||
|
}
|
||||||
cancel_train(first->next);
|
cancel_train(first->next);
|
||||||
free(first);
|
free(first);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ void print_train(struct car* first);
|
|||||||
* Zrusenie vsetkych voznov vo vlaku.
|
* Zrusenie vsetkych voznov vo vlaku.
|
||||||
* @arg smernik na prvy vozen
|
* @arg smernik na prvy vozen
|
||||||
*/
|
*/
|
||||||
void cancel_train(struct car* first);
|
void cancel_train(struct car* first, int val);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Vyradenie vsetkych voznov, ktorych cielova stanica je target
|
* Vyradenie vsetkych voznov, ktorych cielova stanica je target
|
||||||
|
Loading…
Reference in New Issue
Block a user