1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | import java.util.*; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int[] Cmajor = new int[8]; int[] a = {1, 2, 3, 4, 5, 6, 7, 8}; int[] b = {8, 7, 6, 5, 4, 3, 2, 1}; for(int i=0; i<8; i++) { Cmajor[i] = sc.nextInt(); } if(Arrays.equals(Cmajor, a)) { System.out.println("ascending"); } else if(Arrays.equals(Cmajor, b)) { System.out.println("descending"); } else { System.out.println("mixed"); } } } | cs |
'프로그래밍 > 백준' 카테고리의 다른 글
11654 아스키 코드 (0) | 2017.10.15 |
---|---|
10039 평균 점수 (0) | 2017.10.14 |
8958 OX퀴즈 (0) | 2017.10.14 |
2577 숫자의 개수 (0) | 2017.10.14 |
1152 단어의 개수 (0) | 2017.10.07 |