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 |
'알고리즘' 카테고리의 다른 글
백준(BOJ) 1932 (0) | 2018.11.25 |
---|---|
백준(BOJ) 11726 (0) | 2018.11.25 |
백준(BOJ) 2178 (0) | 2018.11.25 |
알고스팟(algospot) JLIS (0) | 2018.11.13 |
백준(BOJ) 11053 (0) | 2018.11.13 |