This commit is contained in:
Anton Dolozin 2025-11-05 00:28:58 +01:00
parent e276d73b22
commit 09c80a77a9

View File

@ -85,7 +85,7 @@ int get_target_capacity(struct station* station,const char* target){
}
ptr = ptr->next;
/* code */
}
return 0;
}
@ -97,11 +97,12 @@ int count_targets(struct station* station){
int count_capacity(struct station* station){
int res = 0;
struct car* ptr = *station->tracks;
while (ptr){
while (ptr && ptr->next){
res += ptr->capacity;
ptr = ptr->next;
}
res += ptr->capacity;
return res;
}