fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <vector>
  4. #include <algorithm>
  5. #include <cmath>
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. vector<float> v;
  11. for(int m = 16; m < 32; ++m)
  12. {
  13. for(int e = 0; e < 8; ++e)
  14. {
  15. v.push_back(m * exp2(-e));
  16. }
  17. }
  18. //sort(v.begin(), v.end());
  19. for(auto n : v)
  20. cout << n << endl;
  21. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
16
8
4
2
1
0.5
0.25
0.125
17
8.5
4.25
2.125
1.0625
0.53125
0.265625
0.132812
18
9
4.5
2.25
1.125
0.5625
0.28125
0.140625
19
9.5
4.75
2.375
1.1875
0.59375
0.296875
0.148438
20
10
5
2.5
1.25
0.625
0.3125
0.15625
21
10.5
5.25
2.625
1.3125
0.65625
0.328125
0.164062
22
11
5.5
2.75
1.375
0.6875
0.34375
0.171875
23
11.5
5.75
2.875
1.4375
0.71875
0.359375
0.179688
24
12
6
3
1.5
0.75
0.375
0.1875
25
12.5
6.25
3.125
1.5625
0.78125
0.390625
0.195312
26
13
6.5
3.25
1.625
0.8125
0.40625
0.203125
27
13.5
6.75
3.375
1.6875
0.84375
0.421875
0.210938
28
14
7
3.5
1.75
0.875
0.4375
0.21875
29
14.5
7.25
3.625
1.8125
0.90625
0.453125
0.226562
30
15
7.5
3.75
1.875
0.9375
0.46875
0.234375
31
15.5
7.75
3.875
1.9375
0.96875
0.484375
0.242188