fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main(){
  5. int n; cin >> n;
  6. double s = 0;
  7. for(int i=0; i <= n; i++){
  8. s += (double)(2*i + 1)/(2*i+2);
  9. }
  10. cout << s;
  11. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
32762.5