프로그래밍 언어/C언어

백준 > 4153 직각삼각형

B612 2021. 12. 20. 15:31
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main() {
	int a, b, c;
	int max = 0;

	while (1) {
		scanf("%d %d %d", &a, &b, &c);

		if (a == 0 && b == 0 && c == 0) {
			break;
		}

		if (a > b && a > c) {
			if (a * a == b * b + c * c) {
				printf("right\n");
			}
			else
				printf("wrong\n");
		}
		else if (b > c) {
			if (b * b == a * a + c * c) {
				printf("right\n");
			}
			else
				printf("wrong\n");
		}
		else {
			if (c * c == a * a + b * b) {
				printf("right\n");
			}
			else
				printf("wrong\n");
		}
	}
}