This commit is contained in:
Oleksandr Vyshniakov 2025-11-12 09:55:02 +01:00
parent b2212e159b
commit c72ffadff8
2 changed files with 35 additions and 0 deletions

View File

@ -1,5 +1,8 @@
#include <stdio.h> #include <stdio.h>
#include "stdlib.h"
#include <string.h>
#define SIZE 100 #define SIZE 100
#include "a_station.h"
struct station { struct station {
struct car** tracks; struct car** tracks;
@ -13,6 +16,7 @@ struct car {
} }
int main() { int main() {
return 0; return 0;
} }

31
du5/a_station.h Normal file
View File

@ -0,0 +1,31 @@
#ifndef A_STATION_H
#define A_STATION_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#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