fork download
  1. /******************************************************************************
  2.  
  3. Welcome to GDB Online.
  4. GDB online is an online compiler and debugger tool for C/C++.
  5. Code, Compile, Run and Debug online from anywhere in world.
  6.  
  7. *******************************************************************************/
  8. #include <iostream>
  9. #include <bits/stdc++.h>
  10. using namespace std;
  11.  
  12. int main()
  13. {
  14. float mile = 1.609344f;
  15. float val = 20.0f * mile;
  16. for (int i = 0; i < 20; i++) {
  17. val += 2.0f * mile;
  18. printf("%i\n", (int)(val / 2.0f / mile) * 2);
  19. }
  20. for (int i = 0; i < 20; i++) {
  21. val -= 2.0f * mile;
  22. printf("%i\n", (int)(val / 2.0f / mile) * 2);
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0.01s 5320KB
stdin
45
stdout
22
24
26
28
30
32
34
36
38
40
42
44
46
48
50
52
54
56
58
60
58
56
54
52
50
48
46
44
42
40
38
36
34
32
30
28
26
24
22
20