From 85377200123c2d377d5854c7c0761780cf7fbd87 Mon Sep 17 00:00:00 2001 From: VIliam Date: Mon, 4 Nov 2024 14:10:40 +0100 Subject: [PATCH] cv6 --- cv6/a_station.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cv6/a_station.c b/cv6/a_station.c index 2d5fb25..f76fdb0 100644 --- a/cv6/a_station.c +++ b/cv6/a_station.c @@ -57,7 +57,15 @@ int index = select_track(station, target); } int count_targets(struct station* station){ - return 0; + int count = 0; + for (int i = 0; i < station->track_count; ++i) { + struct car* current = station->tracks[i]; + while (current) { + ++count; + current = current->next; + } + } + return count; } int count_capacity(struct station* station){