From 34b4ad37fe860de97c867982397dc07dad5c2c17 Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Thu, 3 Dec 2020 15:03:22 +0100 Subject: [PATCH] telegrafista --- a5/program.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/a5/program.c b/a5/program.c index 390baa1..dbb9018 100644 --- a/a5/program.c +++ b/a5/program.c @@ -123,12 +123,16 @@ int main (){ add(root, "----.", '9'); add(root, "-----", '0'); - char line[MAX]; - fgets(line, MAX, stdin); - line[strlen(line)-1] = '\0'; - - search(root, line); - printf("\n"); - printf("\n"); + while(1){ + char line[MAX]; + fgets(line, MAX, stdin); + line[strlen(line)-1] = '\0'; + if(line[0] == '\n'){ + break; + } + search(root, line); + printf("\n"); + printf("\n"); + } destroy(root); }