fork download
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. float n;
  9. cin >> n; // this input is needed to reproduce, but the value doesn't matter
  10. n = 2.98; // overwrite the input value
  11. cout << ""; // comment this out => y = z = 149
  12. float x = n * 50; // 149
  13. float y = ceilf(x); // 150
  14. cout << ""; // comment this out => y = z = 150
  15. float z = ceilf(x); // 149
  16. cout << "x:" << x << " y:" << y << " z:" << z << endl;
  17. }
  18.  
Success #stdin #stdout 0s 3460KB
stdin
2.98

stdout
x:149 y:150 z:149