From 1bd6f8da281df96c6dcd643629cc9a1e6873e50b Mon Sep 17 00:00:00 2001 From: Kozar Date: Fri, 8 Nov 2024 13:24:45 +0000 Subject: [PATCH] Initializacia --- cv6/a_station.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cv6/a_station.c b/cv6/a_station.c index 030e70d..f483f16 100644 --- a/cv6/a_station.c +++ b/cv6/a_station.c @@ -1,3 +1,4 @@ +#include #include "a_station.h" #include #include @@ -23,7 +24,14 @@ void destroy_station(struct station* station){ } int select_track(struct station* station, const char* target){ + size_t length = strlen(target); + int sum = 0; + for (size_t i = 0; i < length; i++) { + sum += target[i]; + } + return sum % station->track_count; } + void add_target_capacity(struct station* station,const char* target, int capacity){ }