From d17289c942cb59874d3146619b5db1c2f013d4f0 Mon Sep 17 00:00:00 2001 From: Radovan Kofira Date: Tue, 10 Nov 2020 21:54:31 +0100 Subject: [PATCH] achhhhh --- cv6/a_station.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) 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; -} -