fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5. int i;
  6. int a;
  7. bool flag = true;
  8. cin >> a;
  9.  
  10. if(a==1){
  11. for(i=1; i<8; i++){
  12. cin >> a;
  13. if(a != i){
  14. flag = false;
  15. break;
  16. }
  17. }
  18. if(flag) cout << "ascending\n";
  19. else cout << "mixed\n";
  20. }
  21. else if(a==8){
  22. for(i=7; i>0; i--){
  23. cin >> a;
  24. if(a != i){
  25. flag = false;
  26. break;
  27. }
  28. }
  29. if(flag) cout << "descending\n";
  30. else cout << "mixed\n";
  31. }
  32. else {
  33. cout << "mixed\n";
  34. }
  35.  
  36. return 0;
  37. }
Success #stdin #stdout 0s 15240KB
stdin
1 2 3 4 5 6 7 8
stdout
mixed