From fcfe4f393959641273da09a6546e88c9e63dec6d Mon Sep 17 00:00:00 2001 From: Bohdan Yanchyk Date: Thu, 2 Apr 2020 23:45:12 +0000 Subject: [PATCH] =?UTF-8?q?Aktualizovat=20=E2=80=9Edu4/program.c=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du4/program.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/du4/program.c b/du4/program.c index 8286384..2cb81f5 100644 --- a/du4/program.c +++ b/du4/program.c @@ -1,11 +1,3 @@ -/****************************************************************************** - - Online C Compiler. - Code, Compile, Run and Debug C program online. -Write your code in this editor and press "Run" button to compile and execute it. - -*******************************************************************************/ - #include #include #include @@ -61,11 +53,17 @@ int main() { char str[100][100]; int i =0; - for(;i<100;i++){ - scanf("%s",str[i]); - } + int j =0; + while((c=getchar())!=EOF){ + if(c=='\n'){ + j=0; + i++; + } + str[i][j]=c; + j++; + } for(int k=0;k