Pagini recente » Cod sursa (job #1818709) | Cod sursa (job #1203539) | Cod sursa (job #1858187) | Cod sursa (job #2564547) | Cod sursa (job #1702455)
#include <fstream>
#include <algorithm>
using namespace std;
int v [ 600000 ] ;
struct cmp {
bool operator () ( const int a , const int b ) const
{
return a < b ;
}
};
bool cmp2 ( int a , int b )
{
return a < b ;
}
ifstream cin ( "algsort.in" ) ;
ofstream cout ( "algsort.out" ) ;
int main()
{
int n ;
cin >> n ;
for ( int i = 1 ; i <= n ; ++ i ) {
cin >> v [ i ] ;
}
//sort ( v + 1 , v + n + 1 , cmp ( ) ) ;
sort ( v + 1 , v + n + 1 , cmp2 ) ;
for ( int i = 1 ; i <= n ; ++ i ) {
cout << v [ i ] << ' ' ;
}
return 0;
}