Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <fstream>
  2. #include <cmath>
  3. using namespace std;
  4. ifstream cin("tg.in");
  5. ofstream cout("tg.out");
  6. long long a, b, c, rez, n;
  7. int main()
  8. {
  9. cin >> n;
  10. for (c = 2; c <= n; ++c)
  11. {
  12. for (a = c - 1; a >= 1; --a)
  13. {
  14. b = a * c;
  15. if (sqrt(b) == (int)sqrt(b))
  16. ++rez;
  17. }
  18. }
  19. cout << rez;
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement