Website Summary Files Commits Branches @commit @diff @stats
path: root / pract_SI / pract. 03 / Solutions / task7.cpp
blob: b02cd7aa2971868b0a8949c7f3251a23f1a0ba1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <iostream>
#define LIMIT 5
#define SEPARATOR " "

using namespace std;

//const short LIMIT = 5;
//const char SEPARATOR = ' ';


int main()
{
	unsigned long long N;
	cin >> N;

	if (N <= LIMIT)
		return -1;

	for (int c = 1; c <= N; c++) {
		for (int b = 1; b <= c; b++) {
			for (int a = 1; a <= b; a++) {
				if ((a * a) + (b * b) == (c * c)) {
					cout << a << SEPARATOR << b << SEPARATOR << c << endl;
				}
			}
		}
	}

	return 0;
}