Изменить 'du4/program.c'

This commit is contained in:
Pavlo Tverdyi 2020-03-31 11:54:11 +00:00
parent b1e6cb9bcc
commit 878e57dee1

View File

@ -19,13 +19,16 @@ int call(float A, float B, float C, char AC){
if(A*B==C)return printf("OK\n"); if(A*B==C)return printf("OK\n");
return printf("ZLE\n"); return printf("ZLE\n");
} }
else if(AC=='/'){ if(AC=='/'){
if(A/B==C)return printf("OK\n"); float Cc=A/B;
return printf("ZLE\n"); 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() int main()
{ {
char *str; char *str;