fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. double x=3.1415926;
  7. for (int i=0;i<100;++i) {
  8. x=2.0*x;
  9. while (x>=1) --x;
  10. cout << i << ' ' << x <<endl;
  11. }
  12. return 0;
  13. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
0 0.283185
1 0.56637
2 0.132741
3 0.265482
4 0.530963
5 0.0619264
6 0.123853
7 0.247706
8 0.495411
9 0.990822
10 0.981645
11 0.96329
12 0.926579
13 0.853158
14 0.706317
15 0.412634
16 0.825267
17 0.650534
18 0.301069
19 0.602138
20 0.204275
21 0.40855
22 0.817101
23 0.634202
24 0.268403
25 0.536806
26 0.0736128
27 0.147226
28 0.294451
29 0.588902
30 0.177805
31 0.35561
32 0.71122
33 0.42244
34 0.844879
35 0.689758
36 0.379517
37 0.759033
38 0.518066
39 0.0361328
40 0.0722656
41 0.144531
42 0.289062
43 0.578125
44 0.15625
45 0.3125
46 0.625
47 0.25
48 0.5
49 0
50 0
51 0
52 0
53 0
54 0
55 0
56 0
57 0
58 0
59 0
60 0
61 0
62 0
63 0
64 0
65 0
66 0
67 0
68 0
69 0
70 0
71 0
72 0
73 0
74 0
75 0
76 0
77 0
78 0
79 0
80 0
81 0
82 0
83 0
84 0
85 0
86 0
87 0
88 0
89 0
90 0
91 0
92 0
93 0
94 0
95 0
96 0
97 0
98 0
99 0