From c4d540bae0c571e442ce7255bf2e11eec3409c59 Mon Sep 17 00:00:00 2001 From: Pavlo Tverdyi Date: Thu, 2 Apr 2020 16:01:13 +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 | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/du4/program.c b/du4/program.c index ad71092..cb5479c 100644 --- a/du4/program.c +++ b/du4/program.c @@ -12,17 +12,17 @@ void add(double a, double b, double c,char ac, int result[],int count){ else result[count]=2; } -double subtr(double a, double b, double c,char ac, int result[],int count){ +void subtr(double a, double b, double c,char ac, int result[],int count){ if(a-b==c) result[count]=1; else result[count]=2; } -double multi(double a, double b, double c,char ac, int result[],int count){ +void multi(double a, double b, double c,char ac, int result[],int count){ if(a*b==c) result[count]=1; else result[count]=2; } -double divi(double a, double b, double c,char ac, int result[],int count){ +void divi(double a, double b, double c,char ac, int result[],int count){ float cc=a/b; double Cc=(int)((a/b)*100000); if(Cc==c || a/b==c || cc==(int)(c*100000)) result[count]=1; @@ -40,15 +40,16 @@ char ac,el=0; int count=0; int eof; for(;eof!=EOF;count++){ - str=(char*)malloc(20); - eof=scanf("%s",str); + eof=0; + str=(char*)malloc(100); int ind=0; - for(int i=0;i