diff --git a/cv6/a_station.c b/cv6/a_station.c index c2d6bd1..d52b8bc 100644 --- a/cv6/a_station.c +++ b/cv6/a_station.c @@ -50,7 +50,7 @@ int select_track(struct station* station, const char* target){ } void add_target_capacity(struct station* station,const char* target, int capacity){ -int i = select_track(station,target); + int i = select_track(station,target); struct car* slot = station->tracks[i]; if(station->tracks[i]==NULL){ struct car* newCar = malloc(sizeof(struct car)); @@ -91,23 +91,21 @@ int count_targets(struct station* station){ counter+=1; newCar=newCar->next; } + } + return counter; +} +int count_capacity(struct station* station){ + int counter=0; + for(int i=0;itrack_count;i++){ + struct car* newCar= station->tracks[i]; + while (newCar->value!=NULL) + { + counter;+=1; + newCar=newCar->next; + } } return counter; } -int count_capacity(struct station* station){ - int count=0; - for(int i=0;itrack_count;i++){ - struct car* newCar= station->tracks[i]; - while (newCar->value!=NULL) - { - count+=1; - newCar=newCar->next; - } - } - - return count; -} -