fork download
  1. #include <cstdio>
  2. #include <cmath>
  3.  
  4. int main()
  5. {
  6. double x;
  7. double y = 3.499999999;
  8.  
  9. scanf("%lf", &x);
  10. printf("%f\n", round(x));
  11. printf("%f", round(y));
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5308KB
stdin
3.4999999999999999
stdout
4.000000
3.000000