标签:blog http os io strong for 2014 amp
#include <iostream> //从小到大排列
#include<algorithm>
#include<vector>
using namespace std;
int main()
{ int i,x;
vector<int>my ;
for(i=1;i<=10; i++)
{
cin>>x;
my.push_back(x);
}
sort(my.begin(),my.end());
for(i=0;i<10;i++)
cout<<my[i]<<" " ;
}
#include <iostream>
#include<algorithm>
#include<vector>
using namespace std;
bool cmp(const int &a,const int &b)
{ if(a!=b) return a>b; else return a>b ; }
int main()
{ int i,x;
vector<int>my ;
for(i=1;i<=10; i++)
{
cin>>x; my.push_back(x);
}
sort(my.begin(),my.end(),cmp);
for(i=0;i<10;i++)
cout<<my[i]<<" " ;
}
标签:blog http os io strong for 2014 amp
原文地址:http://www.cnblogs.com/2014acm/p/3903144.html