Algorithm/BOJ
[BOJ] 4153 직각삼각형
yeeendy
2023. 1. 25. 16:39
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BOJ2609
{
class Program
{
static void Main(string[] args)
{
while (true)
{
string[] input = Console.ReadLine().Split();
int a = int.Parse(input[0]);
int b = int.Parse(input[1]);
int c = int.Parse(input[2]);
if (a == 0 && b == 0 && c == 0)
break;
if (a * a + b * b == c * c)
{
Console.WriteLine("right");
continue;
}
if (a * a + c * c == b * b)
{
Console.WriteLine("right");
continue;
}
if (b * b + c * c == a * a)
{
Console.WriteLine("right");
continue;
}
Console.WriteLine("wrong");
}
}
}
}
브밤님 블로그 참고