From 0f87961d3c037c96c8739667e9ab81650c0c0bc9 Mon Sep 17 00:00:00 2001 From: Yurii Yakovenko Date: Fri, 25 Oct 2024 20:31:57 +0000 Subject: [PATCH] Update a1/program.c --- a1/program.c | 1 + 1 file changed, 1 insertion(+) diff --git a/a1/program.c b/a1/program.c index dd34e0d..4d9939d 100644 --- a/a1/program.c +++ b/a1/program.c @@ -59,6 +59,7 @@ int main() char str[128]; fgets(str,100,stdin); + if(str[strlen(str)-1]=='\n') { str[strlen(str)-1]='\0';} printf("Read: %s", str); int i=0;