프로그래밍/백준
2920 음계
게으른구름
2017. 10. 14. 22:17
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 |