알고리즘

백준(BOJ) 2920

짬뽕얼큰하게 2018. 11. 25. 22:38
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>
 
int main(void){
    bool as = true;
    bool de = true;
    for(int i = 1; i <= 8; i++){
        int n;
        scanf("%d"&n);
        if(n != i) as = false;
        if(n != 9 - i) de = false;
    }
 
    if(as) printf("ascending");
    else if(de) printf("descending");
    else printf("mixed");
 
}
cs