백준
백준 10101 - 삼각형 외우기(C++)
공대생의 잡다한 사전
2023. 12. 9. 23:49
문제 링크입니다. https://www.acmicpc.net/problem/10101
10101번: 삼각형 외우기
문제의 설명에 따라 Equilateral, Isosceles, Scalene, Error 중 하나를 출력한다.
www.acmicpc.net
문제 조건 따라 조건문을 사용하는 문제였습니다.

자세한 것은 코드를 참고해주세요.
#define _CRT_SECURE_NO_WARNINGS
#include <cstring>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstdio>
#include <string>
using namespace std;
int x, y, z;
int main() {
cin.tie(0);
cout.tie(0);
cin >> x >> y >> z;
if(x + y + z != 180){
cout << "Error";
}
else{
if(x == y && y == z) cout << "Equilateral";
else if(x != y && y != z && x != z) cout << "Scalene";
else cout << "Isosceles";
}
return 0;
}

질문 및 조언은 댓글을 남겨주세요.