백준 2920 java
import java.util.Scanner;
public class bj2920
{
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
int result = 0;
int i;
int input[] = new int[8];
for(i = 0; i < 8; i++)
{
input[i] = scanner.nextInt();
}
for(i = 1; i < 8; i++)
{
if(input[0] == 1 && input[i] == input[i-1] + 1)
{
result = 1;
}
else if(input[0] == 8 && input[i] == input[i-1] - 1)
{
result = 2;
}
else
{
result = 3;
break;
}
}
if(result == 1)
{
System.out.println("ascending");
}
else if(result == 2)
{
System.out.println("descending");
}
else
{
System.out.println("mixed");
}
scanner.close();
}
}