백준 문제 풀이 기록
[백준/BOJ]C언어 4153번 직각삼각형
simless786-it
2024. 9. 9. 10:21

#include <stdio.h>
int main()
{
int a, b, c;
while (1) {
scanf_s("%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 && b > a) {
if (b * b == a * a + c * c)
printf("right\n");
else
printf("wrong\n");
}
else {
if (c * c == b * b + a * a)
printf("right\n");
else
printf("wrong\n");
}
}
return 0;
}
나는 비주얼스튜디오를 써서 scanf_s를 해줬는데
백준에서 입력하니 컴파일 에러가 나서
scanf로 고쳐줬다.