백준10101: 삼각형 외우기
문제
https://www.acmicpc.net/problem/10101
문제 풀이
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int sum = a + b + c;
if (sum == 180) {
if (a == b && b == c) {
System.out.println("Equilateral");
} else if (a == b || b == c || a == c) {
System.out.println("Isosceles");
} else {
System.out.println("Scalene");
}
} else {
System.out.println("Error");
}
}
}
댓글남기기