제출답안
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(int argc, char** argv)
{
vector<int> num;
bool same=true;
for(int i=0; i<8; i++){
int n;
cin >> n;
num.push_back(n);
}
vector<int> ascending = num;
vector<int> descending = num;
sort(ascending.begin(), ascending.end());
if(ascending == num) {
cout << "ascending" << endl;
return 0;
}
sort(descending.begin(), descending.end(), [](int a, int b)
{
return a > b;
});
if(descending == num){
cout << "descending" << endl;
return 0;
}
cout << "mixed" << endl;
return 0;
}
제출 결과