fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. double power(double a, double b) {
  4. double ans = 1;
  5. for(int i = 1; i <= b; i++){
  6. ans *= a;
  7. }
  8. return ans;
  9. }
  10.  
  11. int main()
  12. {
  13. double anaconda = 0;
  14. for(int i = 0; i < 25; i++){
  15. anaconda += power(10,i);
  16. cout << setprecision(30) << fixed <<i << " "<< anaconda << endl;
  17. }
  18.  
  19. }
Success #stdin #stdout 0s 5624KB
stdin
Standard input is empty
stdout
0 1.000000000000000000000000000000
1 11.000000000000000000000000000000
2 111.000000000000000000000000000000
3 1111.000000000000000000000000000000
4 11111.000000000000000000000000000000
5 111111.000000000000000000000000000000
6 1111111.000000000000000000000000000000
7 11111111.000000000000000000000000000000
8 111111111.000000000000000000000000000000
9 1111111111.000000000000000000000000000000
10 11111111111.000000000000000000000000000000
11 111111111111.000000000000000000000000000000
12 1111111111111.000000000000000000000000000000
13 11111111111111.000000000000000000000000000000
14 111111111111111.000000000000000000000000000000
15 1111111111111111.000000000000000000000000000000
16 11111111111111112.000000000000000000000000000000
17 111111111111111104.000000000000000000000000000000
18 1111111111111111168.000000000000000000000000000000
19 11111111111111110656.000000000000000000000000000000
20 111111111111111114752.000000000000000000000000000000
21 1111111111111111081984.000000000000000000000000000000
22 11111111111111111344128.000000000000000000000000000000
23 111111111111111109246976.000000000000000000000000000000
24 1111111111111111092469760.000000000000000000000000000000