#include <iostream>
#include <algorithm>
#include <math.h>
int compare_desc(const void *a , const void *b) ;
void main()
{
int A[3] = {2 , 1 , 3} ;
qsort(A , 3 , sizeof(int) , compare_desc) ;
for (int i = 0 ; i < 3 ; i++)
{
std::cout<<A[i]<<"\t" ;
}
system("pause") ;
}
int compare_desc(const void *a , const void *b)
{
int a_value = *(int *)a ;
int b_value = *(int *)b ;
return b_value - a_value ;
}