From 878e57dee1b14cac43b386f8affe18f95e7c174c Mon Sep 17 00:00:00 2001 From: Pavlo Tverdyi Date: Tue, 31 Mar 2020 11:54:11 +0000 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20'du4/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du4/program.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/du4/program.c b/du4/program.c index d941c4a..d72e235 100644 --- a/du4/program.c +++ b/du4/program.c @@ -19,13 +19,16 @@ int call(float A, float B, float C, char AC){ if(A*B==C)return printf("OK\n"); return printf("ZLE\n"); } - else if(AC=='/'){ - if(A/B==C)return printf("OK\n"); - return printf("ZLE\n"); + if(AC=='/'){ + float Cc=A/B; + Cc=(int)(Cc*100000); + Cc=(float)Cc/100000; + if(Cc==C)return printf("OK"); + printf("%f",Cc); + return printf("ZLE"); } - return printf("CHYBA\n"); + return printf("CHYBA"); } - int main() { char *str;