Advertisement
anhkiet2507

TongPhanThuc

Apr 17th, 2021
2,094
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.20 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main()
  5. {
  6. long long i, n;
  7. float tong = 1;
  8. scanf("%lld", &n);
  9. for (i = 2; i<=n ; ++i){
  10.     tong = (tong + ((float)1)/i);
  11. }
  12. printf("%.4lf", tong);
  13. return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement