From 1efb9b92961cd8ee17d700b252f1ac09e8dd4620 Mon Sep 17 00:00:00 2001 From: Pavlo Tverdyi Date: Fri, 3 Apr 2020 00:07:43 +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 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/du4/program.c b/du4/program.c index 26c0b9c..f008d89 100644 --- a/du4/program.c +++ b/du4/program.c @@ -42,11 +42,15 @@ int eof; for(;eof!=EOF;count++){ eof=0; int k=0; + int ro=0; str=(char*)malloc(100); int ind=0; for(int i=0;eof!='\n';i++){ eof=getchar(); if(eof==EOF) break; + if(eof=='='){ + ro++; + } if(!isdigit(eof) && eof!='.' && eof!=' ' && eof!='='){ k++; } @@ -54,6 +58,10 @@ for(;eof!=EOF;count++){ str[ind]=eof; ind++; } + } + if(ro==0){ + result[count]=3; + break; } if(eof==EOF) break; sscanf(str,"%lF%c%lF=%lF ",&a,&ac,&b,&c); @@ -78,6 +86,7 @@ for(;eof!=EOF;count++){ default: result[count]=3; } + } count--; for(int j=0;j