Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, i, j, k;
- cin >> n;
- for(i=1; i<=n; i++)
- {
- for (j=i; (j<=n) ; j++)
- {
- for (k=j; (k<=n);k++)
- if (i*i + j*j == k*k)
- cout << i << " " << j << " " << k << endl;
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment