From c72ffadff83e03084c7d2063f01c497abf389cd0 Mon Sep 17 00:00:00 2001 From: ov075wu Date: Wed, 12 Nov 2025 09:55:02 +0100 Subject: [PATCH] refresh --- du5/a_program.c | 4 ++++ du5/a_station.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 du5/a_station.h diff --git a/du5/a_program.c b/du5/a_program.c index 8348247..ba9b598 100644 --- a/du5/a_program.c +++ b/du5/a_program.c @@ -1,5 +1,8 @@ #include +#include "stdlib.h" +#include #define SIZE 100 +#include "a_station.h" struct station { struct car** tracks; @@ -13,6 +16,7 @@ struct car { } + int main() { return 0; } \ No newline at end of file diff --git a/du5/a_station.h b/du5/a_station.h new file mode 100644 index 0000000..54ceac1 --- /dev/null +++ b/du5/a_station.h @@ -0,0 +1,31 @@ +#ifndef A_STATION_H +#define A_STATION_H + +#include +#include +#include + +#define SIZE 100 +#define STATION_SIZE 10 + +struct car { + int capacity; + char value[SIZE]; + struct car* next; +}; + +struct station { + struct car** tracks; + int track_count; +}; + +struct station* create_station(); +void destroy_station(struct station* s); +int select_track(struct station* s, const char* target); +void add_target_capacity(struct station* s, const char* target, int capacity); +struct car* find_target(struct station* s, const char* target); +int get_total_targets(struct station* s); +int get_total_capacity(struct station* s); +void print_station(struct station* s); + +#endif