Little Jay

[C++] 백준 4153번 직각삼각형 본문

알고리즘/BOJ

[C++] 백준 4153번 직각삼각형

Jay, Lee 2021. 3. 26. 14:11
#include <iostream>
using namespace std;

int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int a, b, c;
	while (true) {
		cin >> a >> b >> c;
		if (a == 0 && b == 0 && c == 0)
			break;
		else {
			if (a * a + b * b == c * c || a * a + c * c == b * b || b * b + c * c == a * a) {
				cout << "right" << "\n";
			}
			else {
				cout << "wrong" << "\n";
			}
		}
	}

	return 0;
}
Comments