fork download
  1. #include <iostream>
  2. #include <stdio.h>
  3. using namespace std;
  4.  
  5. int main(int argc, char const *argv[]) {
  6. int n[8];
  7. string out;
  8. for(int i=0; i<8; i++){
  9. cin>> n[i];
  10. }
  11. for(int i=0; i<8; i++){
  12. if(n[i] ==1+i){
  13. out = "ascending";
  14. }
  15. else if(n[i] ==8-i){
  16. out = "descending";
  17. }
  18. else{
  19. out = "mixed";
  20. }
  21. }
  22. cout<< out;
  23. }
Success #stdin #stdout 0.01s 5304KB
stdin
1 7 6 5 4 3 2 8
stdout
ascending