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

This commit is contained in:
Pavlo Tverdyi 2020-04-01 09:33:46 +00:00
parent 1c8b217cb3
commit c78c1c0e2f

View File

@ -5,24 +5,19 @@
char add(double A, double B, double C,char AC){ char add(double A, double B, double C,char AC){
if(A+B==C)return printf("OK\n"); if(A+B==C)return printf("OK\n");
printf("%lf",A+B);
return printf("ZLE\n"); return printf("ZLE\n");
} }
char subtr(double A, double B, double C,char AC){ char subtr(double A, double B, double C,char AC){
if(A-B==C)return printf("OK\n"); if(A-B==C)return printf("OK\n");
printf("%lf",A-B);
return printf("ZLE\n"); return printf("ZLE\n");
} }
char multi(double A, double B, double C,char AC){ char multi(double A, double B, double C,char AC){
if(A*B==C)return printf("OK\n"); if(A*B==C)return printf("OK\n");
printf("%lf",A*B);
return printf("ZLE\n"); return printf("ZLE\n");
} }
char divi(double A, double B, double C,char AC){ char divi(double A, double B, double C,char AC){
float CC=A/B; float CC=A/B;
printf("%f",CC);
if(CC==C || A/B==C)return printf("OK\n"); if(CC==C || A/B==C)return printf("OK\n");
printf("%lf",A/B);
return printf("ZLE\n"); return printf("ZLE\n");
} }