achhhhh
This commit is contained in:
parent
66e7bf7fad
commit
d17289c942
@ -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;i<station->track_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;i<station->track_count;i++){
|
||||
struct car* newCar= station->tracks[i];
|
||||
while (newCar->value!=NULL)
|
||||
{
|
||||
count+=1;
|
||||
newCar=newCar->next;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user