文章
43
粉丝
180
获赞
21
访问
196.2k
#include <iostream>
#include <algorithm>
using namespace std;
int n, a;
vector<int> s, cpy;
int main()
{
while (cin >> n)
{
s.clear(); cpy.clear();
while (n -- )
{
cin >> a;
s.push_back(a);
}
cpy = s;
sort(cpy.begin(), cpy.end());
bool flg = true;
for (int i = 0, j = s.size() - 1; i < s.size(); i ++, j --)
if (s[i] != cpy[j]) flg = false;
if (cpy == s) puts("Ascending");
else if (flg) puts("Descending order");
else puts("The testing machine is out of order!");
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发