Scroll indicator done
728x90

https://www.acmicpc.net/problem/5073


#include <iostream>
#include <cmath>
using namespace std;

int a, b, c;
bool E() {
	return (a == b && b == c) ? true : false;
}

bool I() {
	return (a == b || b == c || c == a) ? true : false;
}

int main() {
	ios::sync_with_stdio();
	cin.tie();

	while (true) {
		cin >> a >> b >> c;
		if (a == 0 && b == 0 && c == 0) break;
		else {
			int tmp = max(a, max(b, c));
			if ((2 * tmp) >= (a + b + c)) 
				cout << "Invalid" << "\n";
			else {
				if (E()) {
					cout << "Equilateral" << '\n';
				}
				else if (I()) {
					cout << "Isosceles" << '\n';
				}
				else {
					cout << "Scalene" << "\n";
				}
			}
		}
	}
}

 

728x90

'BAEKJOON > C++' 카테고리의 다른 글

[B2467][용액][C++]  (0) 2023.01.26
[B1213][팰린드롬 만들기][C++]  (0) 2023.01.26
[B21608][상어 초등학교][C++]  (0) 2023.01.20
[B14889][스타트와 링크][C++]  (0) 2023.01.05
[B14888][연산자 끼워넣기][C++]  (0) 2023.01.03