diff --git a/a_station.c b/a_station.c index 7647b32..d5322dc 100644 --- a/a_station.c +++ b/a_station.c @@ -1,6 +1,7 @@ #include "a_station.h" #include #include +#include struct station* create_station(){ struct station* station = calloc(1,sizeof(struct station)); @@ -65,10 +66,19 @@ void add_target_capacity(struct station* station,const char* target, int capacit } int get_target_capacity(struct station* station,const char* target){ + int track = select_track(station,target); + struct car* start = station->tracks[track]; + while(start->next != NULL){ + if(strcmp(start->value,target)== 0){ + return start->capacity; + } + start = start->next; + } return 0; } int count_targets(struct station* station){ + return 0; }