Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <cmath>
- using namespace std;
- ifstream cin("tg.in");
- ofstream cout("tg.out");
- long long a, b, c, rez, n;
- int main()
- {
- cin >> n;
- for (c = 2; c <= n; ++c)
- {
- for (a = c - 1; a >= 1; --a)
- {
- b = a * c;
- if (sqrt(b) == (int)sqrt(b))
- ++rez;
- }
- }
- cout << rez;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement