-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path9366.cpp
47 lines (45 loc) · 1.01 KB
/
9366.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// 9366. 삼각형 분류
// 2021.06.28
// 수학
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
int t;
cin >> t;
for (int i = 1; i <= t; i++)
{
vector<int> side(3);
cin >> side[0] >> side[1] >> side[2];
sort(side.begin(), side.end());
cout << "Case #" << i << ": ";
if (side[0] == side[1] && side[1] == side[2])
{
cout << "equilateral" << endl;
}
else if (side[1] == side[0] || side[1] == side[2] || side[2] == side[0])
{
if (side[2] < side[0] + side[1])
{
cout << "isosceles" << endl;
}
else
{
cout << "invalid!" << endl;
}
}
else
{
if (side[2] < side[0] + side[1])
{
cout << "scalene" << endl;
}
else
{
cout << "invalid!" << endl;
}
}
}
}