From 229935b4f80889bcd1c14745808b3df7311c4501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Gejdo=C5=A1?= Date: Thu, 23 Apr 2026 13:42:41 +0000 Subject: [PATCH] kapacita --- du6/a_station.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/du6/a_station.c b/du6/a_station.c index 9fe09ae..c1c6f64 100644 --- a/du6/a_station.c +++ b/du6/a_station.c @@ -63,6 +63,15 @@ int count_targets(struct station* station){ } int count_capacity(struct station* station){ - return 0; + int capacity = 0; + + for (int i = 0; i < station -> track_count; i++;){ + struct car* vagon = station ->tracks[i]; // kontrolujem kazdu kolaj, kazdy vagon linked hash tablu + while (vagon) { + capacity = capacity + vagon -> capacity; + vagon = vagon -> next; // zapisem kapacitu kazdeho vagonu na kolaji + } + } + return capacity; }