diff --git a/cv6/a_station.c b/cv6/a_station.c index a081b8c..9796ce3 100644 --- a/cv6/a_station.c +++ b/cv6/a_station.c @@ -53,11 +53,32 @@ void add_target_capacity(struct station* station,const char* target, int capacit } int get_target_capacity(struct station* station,const char* target){ + for(int i=0;itrack_count;i++){ + struct car* newCar= station->tracks[i]; + while (newCar->value!=NULL) + { + if(strcmp(newCar->value,target)==0){ + return newCar->capacity; + } + newCar=newCar->next; + } + } return 0; } int count_targets(struct station* station){ - return 0; + 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){