Advertisement
SergeyPGUTI

3.2.8

Sep 30th, 2015
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int n;
  9.     double Sum=0;
  10.     cin>>n;
  11.     for (int i=1;i<=n;i++)
  12.     {
  13.         Sum+=(1.0/i)*(1.0/i);
  14.     }
  15.  
  16.     cout<<Sum;
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement