[boj] (b3) 4153 직각삼각형
✅ 구현
문제

풀이
#include <cmath>
pow(a, 2)
코드
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
    int a, b, c;
    while (1)
    {
        cin >> a >> b >> c;
        if (a == 0 && b == 0 && c == 0)
            break;
        int M = max(a, max(b, c));
        if (M == a)
        {
            if (pow(a, 2) == (pow(b, 2) + pow(c, 2)))
                cout << "right" << endl;
            else
                cout << "wrong" << endl;
        }
        else if (M == b)
        {
            if (pow(b, 2) == (pow(a, 2) + pow(c, 2)))
                cout << "right" << endl;
            else
                cout << "wrong" << endl;
        }
        else
        {
            if (pow(c, 2) == (pow(b, 2) + pow(a, 2)))
                cout << "right" << endl;
            else
                cout << "wrong" << endl;
        }
    }
}
                
                    
        
    
    
    
    
    
                
                
                
                
                    
                        
                            
                            
                            Author And Source
                            
                            이 문제에 관하여([boj] (b3) 4153 직각삼각형), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
                                
                                https://velog.io/@peanut_/boj-b3-직각삼각형
                            
                            
                            
                                저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
                            
                            
                                
                                
                                 우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                            
                            
                        
                    
                
                
                
            
#include <cmath>
pow(a, 2)#include <iostream>
#include <cmath>
using namespace std;
int main()
{
    int a, b, c;
    while (1)
    {
        cin >> a >> b >> c;
        if (a == 0 && b == 0 && c == 0)
            break;
        int M = max(a, max(b, c));
        if (M == a)
        {
            if (pow(a, 2) == (pow(b, 2) + pow(c, 2)))
                cout << "right" << endl;
            else
                cout << "wrong" << endl;
        }
        else if (M == b)
        {
            if (pow(b, 2) == (pow(a, 2) + pow(c, 2)))
                cout << "right" << endl;
            else
                cout << "wrong" << endl;
        }
        else
        {
            if (pow(c, 2) == (pow(b, 2) + pow(a, 2)))
                cout << "right" << endl;
            else
                cout << "wrong" << endl;
        }
    }
}Author And Source
이 문제에 관하여([boj] (b3) 4153 직각삼각형), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@peanut_/boj-b3-직각삼각형저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)