IT 프로그래밍/백준

[c++] 10101번 삼걱형 외우기

기술1 2024. 6. 1. 17:01

문제

코드

#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int a, b, c;

	cin >> a >> b >> c;

	if (a + b + c != 180)
	{
		cout << "Error" << endl;
	}
	else
	{
		if (a == 60 && b == 60 && c == 60)
		{
			cout << "Equilateral" << endl;
		}
		else if (a == b || a == c || b == c)
		{
			cout << "Isosceles" << endl;
		}
		else
		{
			cout << "Scalene" << endl;
		}
	}


	return 0;
}

 

풀이

설명이 굳이 필요없는 문제입니다.

 

그저 다라서 하면 됩니다. 

 

if else 로 하고 이중 if문을 통해 해결해주었습니다.