반응형
SMALL
package backjoon;
import java.util.*;
public class 삼각형변계산 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (true){
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
if(a==0 && b==0 && c==0){
break;
}
int max = Math.max(a,Math.max(b,c));
if(max < a + b + c - max){
if(a==b && b==c && c==a){
System.out.println("Equilateral");
} else if (a==b || b==c || c==a) {
System.out.println("Isosceles");
} else if (a!=b || b!=c || c!=a) {
System.out.println("Scalene");
}else {
System.out.println("Invalid");
}
}else {
System.out.println("Invalid");
}
}
}
}
반응형
LIST
'JAVA > JAVA baekjoon' 카테고리의 다른 글
2차원 배열 max, 행, 열 찾기 (0) | 2023.08.16 |
---|---|
색종이 (0) | 2023.08.16 |
진법 변환 (0) | 2023.08.16 |
중앙이동알고리즘 (0) | 2023.08.16 |
거스름돈 계산 (0) | 2023.08.16 |