From 3ce22c874ab2e7c905b0b99281f64935cccadb18 Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Sun, 29 Nov 2020 19:02:03 +0100 Subject: [PATCH] station --- cv6/main.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 cv6/main.c diff --git a/cv6/main.c b/cv6/main.c new file mode 100644 index 0000000..4ede202 --- /dev/null +++ b/cv6/main.c @@ -0,0 +1,64 @@ +#include +#include +#include +#include +#include +#include "a_station.h" + +void print_station(struct station* station){ + // Vypise celu stanicu + printf("station>>>\n"); + // Prechadza vsetky trate + for (int i = 0 ; i< station->track_count; i++){ + struct car* start = station->tracks[i]; + struct car* this = start; + // Prechadza vsetky vozne + while(this != NULL){ + printf("%s %d -> ",this->value,this->capacity); + this=this->next; + } + printf("NULL\n"); + } + printf("<<