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) {
|
||||
struct car* this;
|
||||
void cancel_train(struct car* first, int val) {
|
||||
if(first == NULL){
|
||||
exit(0);
|
||||
}
|
||||
else{
|
||||
else if(first->next == NULL){
|
||||
struct car* this;
|
||||
this = first;
|
||||
first = this->next;
|
||||
free(this);
|
||||
}
|
||||
cancel_train(first->next);
|
||||
free(first);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -40,7 +40,7 @@ void print_train(struct car* first);
|
||||
* Zrusenie vsetkych voznov vo vlaku.
|
||||
* @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
|
||||
|
Loading…
Reference in New Issue
Block a user