From b9a9f2551dfd2a3e5b3d369d1912e91c9bbef3de Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Thu, 3 Dec 2020 15:12:11 +0100 Subject: [PATCH] telegrafista --- a5/program.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/a5/program.c b/a5/program.c index 1a45126..3b2f2d1 100644 --- a/a5/program.c +++ b/a5/program.c @@ -60,6 +60,7 @@ void search(struct morsetree* root, char* decode){ int i = 0; for(i == 0; i <= strlen(decode); i++){ if(i == strlen(decode) && decode[strlen(decode)-1] == ' '){ + printf("\n"); return; } if(decode[i] == ' ' || decode[i] == '\n' || decode[i] == '\0'){ @@ -79,7 +80,7 @@ void search(struct morsetree* root, char* decode){ } } - printf("\n"); + } @@ -129,6 +130,7 @@ int main (){ fgets(line, MAX, stdin); line[strlen(line)-1] = '\0'; if(line[0] == '\0'){ + printf("\n"); destroy(root); return 0; }