mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1397.cpp
This commit is contained in:
parent
d7f974c40e
commit
2c10f602a4
36
QUSTOJ/1397.cpp
Normal file
36
QUSTOJ/1397.cpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
vector<int> bus;
|
||||
bus.clear();
|
||||
int tmp;
|
||||
for(int i=0;i<10;i++)
|
||||
{
|
||||
cin>>tmp;
|
||||
bus.push_back(tmp);
|
||||
}
|
||||
int x;
|
||||
for(x=0;x<10;x++)
|
||||
{
|
||||
if(bus[x]!=x+1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(x==10)
|
||||
{
|
||||
cout<<"10 9 8 7 6 5 4 3 2 1"<<endl;
|
||||
return 0;
|
||||
}
|
||||
sort(bus.begin(),bus.end());
|
||||
for(int i=9;i>=0;i--)
|
||||
{
|
||||
cout<<bus[i]<<" ";
|
||||
}
|
||||
cout<<endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user