From e6d12c5c1c6b9f8d9040867e51a5902fa293cc55 Mon Sep 17 00:00:00 2001 From: Anton Dolozin Date: Wed, 5 Nov 2025 11:31:36 +0100 Subject: [PATCH] Fixing counting --- du5/a_station.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/du5/a_station.c b/du5/a_station.c index 4727626..1ce6936 100644 --- a/du5/a_station.c +++ b/du5/a_station.c @@ -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; itrack_count; i++){ + struct car* ptr = station->tracks[i]; + while(ptr){ + total++; + ptr = ptr->next; + } + +} +return total; } int count_capacity(struct station* station){