Advertisement
muntasir1903110

cf1293

Mar 31st, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include<bits\stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. ios_base::sync_with_stdio(false);
  7. cin.tie(NULL);
  8. int n;
  9. double p;
  10. cin>>n;
  11. for(int i = 1;i<=n;i++)
  12. {
  13. p+=(double)(1.0/i);
  14. }
  15. cout<<fixed<<setprecision(12)<<p<<endl;
  16. return 0;
  17.  
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement