fork download
  1. #include <iostream>
  2. int main(){
  3. double w = 1 / 2.0, r = 0;
  4. for (int i = 0; i <= 50; ++i) {
  5. w *= 3;
  6. r += w;
  7. }
  8. std::cout << r;
  9. return 0;
  10. }
Success #stdin #stdout 0s 2896KB
stdin
Standard input is empty
stdout
1.61527e+24