标签:blog http os io for 2014 amp log
#include <iostream>
#include<algorithm>
using namespace std;
int a[5];
int main( )
{
int i;
for(i=0;i<5 ;i++) cin>>a[i] ;
sort(a,a+5);
for(i=0;i<5 ;i++) cout<<a[i]<<" " ;
cout<<endl;
}
***********************************************************************************
#include <iostream>
#include<algorithm>
using namespace std;
int a[5];
bool cmp( const int &a,const int &b)
{ if(a!=b) return a>b; else return a>b ; }
int main( )
{
int i;
for(i=0;i<5 ;i++) cin>>a[i] ;
sort(a,a+5,cmp);
for(i=0;i<5 ;i++) cout<<a[i]<<" " ;
cout<<endl;
}
标签:blog http os io for 2014 amp log
原文地址:http://www.cnblogs.com/2014acm/p/3903098.html