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