Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int limit = 100;
- int count = 0;
- for (int a = 1; a <= limit; a++)
- {
- for (int b = a; b <= limit; b++)
- {
- // b>=a, чтобы не дублировать тройку (a,b,c) и (b,a,c)
- for (int c = b; c <= limit; c++)
- {
- if (a*a + b*b == c*c)
- {
- count++;
- cout << count << ") (" << a << ", "
- << b << ", " << c << ")\n";
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement