This commit is contained in:
Anton Dolozin 2025-11-05 00:59:28 +01:00
parent 7585891ae1
commit 9f096f6d20

View File

@ -109,13 +109,9 @@ int count_targets(struct station* station){
}
int count_capacity(struct station* station){
int res = 0;
struct car* ptr = *station->tracks;
while (ptr){
res += ptr->capacity;
ptr = ptr->next;
}
return res;
int total = 0;
for (struct car* ptr = *station->tracks; ptr; ptr = ptr->next)
total += ptr->capacity;
return total;
}