funguje
This commit is contained in:
parent
f3b49f8e4c
commit
350dd19960
BIN
du4/program
BIN
du4/program
Binary file not shown.
@ -105,6 +105,9 @@ int main(){
|
||||
msum=values[2];
|
||||
if(operation=='+'){
|
||||
rsum=values[0]+values[1];
|
||||
char rmsum[50];
|
||||
sprintf(rmsum, "%.2f", msum);
|
||||
msum = atof(rmsum);
|
||||
if(msum==rsum){
|
||||
printf("OK\n");
|
||||
}
|
||||
@ -115,6 +118,9 @@ int main(){
|
||||
}
|
||||
else if(operation=='-'){
|
||||
rsum=values[0]-values[1];
|
||||
char rmsum[50];
|
||||
sprintf(rmsum, "%.2f", msum);
|
||||
msum = atof(rmsum);
|
||||
if(msum==rsum){
|
||||
printf("OK\n");
|
||||
}
|
||||
@ -125,6 +131,9 @@ int main(){
|
||||
}
|
||||
else if(operation=='*'){
|
||||
rsum=values[0]*values[1];
|
||||
char rmsum[50];
|
||||
sprintf(rmsum, "%.2f", msum);
|
||||
msum = atof(rmsum);
|
||||
if(msum==rsum){
|
||||
printf("OK\n");
|
||||
}
|
||||
@ -135,6 +144,9 @@ int main(){
|
||||
}
|
||||
else if(operation=='/'){
|
||||
rsum=values[0]/values[1];
|
||||
char rmsum[50];
|
||||
sprintf(rmsum, "%.2f", msum);
|
||||
msum = atof(rmsum);
|
||||
if(msum==rsum){
|
||||
printf("OK\n");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user