From 9f096f6d2017953b26af5bf9fc1b1b97eed467c6 Mon Sep 17 00:00:00 2001 From: Anton Dolozin Date: Wed, 5 Nov 2025 00:59:28 +0100 Subject: [PATCH] hfwuhfbw --- du5/a_station.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/du5/a_station.c b/du5/a_station.c index a7af519..1b4da0c 100644 --- a/du5/a_station.c +++ b/du5/a_station.c @@ -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; }