20 for (
int i = 0; i < n; i++) {
37 while (current->
next != NULL) {
38 current = current->
next;
47 Car *current = head; (*current).
next
48 while (current != NULL) {
49 if (current->
next != NULL) {
50 cout << current->
id <<
", ";
55 current = current->
next;
void appendCar(Car *&head, string id)
void printTrain(Car *&head)