Fixing counting

This commit is contained in:
Anton Dolozin 2025-11-05 11:31:36 +01:00
parent 39b29d3131
commit e6d12c5c1c

View File

@ -72,8 +72,17 @@ int count_targets(struct station* station){
if(station == NULL || station->tracks == NULL){
return 0;
}
return 0;
int total = 0;
for(int i = 0; i<station->track_count; i++){
struct car* ptr = station->tracks[i];
while(ptr){
total++;
ptr = ptr->next;
}
}
return total;
}
int count_capacity(struct station* station){