#include <iostream>
#include<stdlib.h>
using namespace std;
static int cnt;
int compare(const void *a, const void *b)
{
cnt+=1;
int l = *(int*)a;
int r= *(int*)b;
return l-r;
}
int main() {
// your code goes here
int a[]= {10,9,8,7,6,5};
int size= sizeof(a)/sizeof(a[0]);
int i;
qsort(a,size,sizeof(int),compare);
for(i=0;i<6;i++)
cout<<a[i]<<" ";
cout<<endl<<cnt<<endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZTxzdGRsaWIuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnN0YXRpYyBpbnQgY250OwoKaW50IGNvbXBhcmUoY29uc3Qgdm9pZCAqYSwgY29uc3Qgdm9pZCAqYikKewoJY250Kz0xOwoJaW50IGwgPSAqKGludCopYTsKCWludCByPSAqKGludCopYjsKCXJldHVybiBsLXI7Cn0KCmludCBtYWluKCkgewoJLy8geW91ciBjb2RlIGdvZXMgaGVyZQoJaW50IGFbXT0gezEwLDksOCw3LDYsNX07CglpbnQgc2l6ZT0gc2l6ZW9mKGEpL3NpemVvZihhWzBdKTsKCWludCBpOwoJcXNvcnQoYSxzaXplLHNpemVvZihpbnQpLGNvbXBhcmUpOwoJCglmb3IoaT0wO2k8NjtpKyspCgkgY291dDw8YVtpXTw8IiAiOwoJIAoJIGNvdXQ8PGVuZGw8PGNudDw8ZW5kbDsKCXJldHVybiAwOwp9