#include
#include
#include
#include
#include
#define MAXN 10000000using namespace std ;int a[MAXN] , n , nsize , tmp[MAXN] ;int cmp( const void * _a , const void * _b )
{
int *a = ( int* )_a ;
int *b = ( int* )_b ;
return *a - *b ;
}void distinct()
{
nsize = 0 ;
for( int i = 0 ; i < n ; ++i )
{
if( a[i] != a[i+1] )
{
tmp[nsize++] = a[i] ;
}
}
memcpy( a , tmp , sizeof( int )*nsize ) ;
}int main()
{
cout << "表中元素个数为:(不超过10000000)" << endl ;
cin >> n ;
for( int i = 0 ; i < n ; ++i )
{
cin >> a[i] ;
}
//非递减排序
qsort( a , n , sizeof( int ) , cmp ) ;
//删除相同元素
distinct() ;
//输出去重后的表,10个一行
int cnt = 0 ;
for( int i = 0 ; i < nsize ; ++i )
{
if( cnt == 10 )
cout << endl ;
cout << a[i] << " ";
}
return 0 ;
}