From 3bd08662645c6a69d1b5dc3c83e58743b41b5f8e Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Mon, 30 Nov 2020 14:50:00 +0100 Subject: [PATCH] main --- cv6/main.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/cv6/main.c b/cv6/main.c index b8ba8d5..ad8a969 100644 --- a/cv6/main.c +++ b/cv6/main.c @@ -63,8 +63,24 @@ void test_station(struct station* station){ int main(){ struct station* station = create_station(); - test_station(station); + //test_station(station); + printf("Zadajte stanicu na pridanie do zoznamu:\n"); + char add[30]; + fgets(add, 30, stdin); + add[strlen(add)-1] = '\0'; + printf("Zadajte capacitu stanice:\n"); + + char cap[10]; + fgets(cap,10,stdin); + cap[strlen(cap)-1] = '\0'; + int n = atoi(cap); + add_target_capacity(station,add,n); + test_station(station); + + printf("\n"); + print_station(station); + printf("\n"); printf("Zadajte hľadanu stanicu:\n"); char find[30]; fgets(find,30,stdin); @@ -78,7 +94,9 @@ int main(){ } else{ printf("Capacita na danej statice: %d\n", s); + } + destroy_station(station); return 0; }