Advertisement
hungkt1997

ktll-lab4.3

Apr 14th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. float n, x,s;
  6. s = 0;
  7. cout << ("nhap so x=");
  8. cin >> x;
  9. for (n = 1; n <= x ; n++)
  10. {
  11. s = s+1/(n*n);
  12. }
  13. cout << s << endl;
  14. system("pause");
  15. return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement