POJ 1007

来源:互联网 发布:网络与信息安全就业 编辑:程序博客网 时间:2024/04/30 05:11

 

学习点 qsort对一级结构体排序

Struct IN

{

       Double data;

       Int other;

}s[100];

 

Int cmp(const void *a, const void *b)

{

       Return (*(struct IN *)a).data-(*(struct IN *)a).data;

}

Qsort(s, 100, sizeof(s[0], cmp));

 

原创粉丝点击