fork download
  1. // Online C++ compiler to run C++ program online
  2. #include <iostream>
  3. # include <cmath>
  4. using namespace std;
  5. int main() {
  6. // Write C++ code here
  7. double a, b;
  8. cin>> a >> b;
  9. double x = a / b;
  10. cout<< "floor " << a << " / " <<b<< " = " <<floor (x) << endl;
  11. cout<< "ceil " << a << " / " <<b<< " = " << ceil (x) << endl;
  12. cout<< "round " << a << " / " <<b<< " = " << round (x) << endl;
  13. return 0;
  14. }
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
floor 4.65243e-310 / 6.95257e-310 = 0
ceil 4.65243e-310 / 6.95257e-310 = 1
round 4.65243e-310 / 6.95257e-310 = 1