fork download
  1. #include <iostream>
  2. #include <cmath>
  3. #include <iomanip>
  4. using namespace std;
  5.  
  6. int main() {
  7. double x = 0.0;
  8. while (x < 1.0){
  9. x = x + 0.1;
  10. cout << x << endl;
  11. cout << setprecision(21) << endl;
  12. }
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0.01s 5320KB
stdin
1
2
10
42
11
stdout
0.1

0.200000000000000011102

0.300000000000000044409

0.400000000000000022204

0.5

0.599999999999999977796

0.699999999999999955591

0.799999999999999933387

0.899999999999999911182

0.999999999999999888978

1.09999999999999986677