資源簡介
代碼片段和文件信息
#include
#include
#include?
#define?MAXID?6
#define?MAXNAME?8
#define?MAXN?100000
struct?Student?{
char?id[MAXID+1];
char?name[MAXNAME+1];
int?grade;
}?Record[MAXN];
int?ComparId(const?void?*a?const?void?*b)
{??
???return?strcmp(((const?struct?Student*)a)->id
?????????????((const?struct?Student*)b)->id);
}
int?ComparName(const?void?*a?const?void?*b)
{??
int?k?=?strcmp(((const?struct?Student*)a)->name
???????????((const?struct?Student*)b)->name);
if?(!k)?
k?=?strcmp(((const?struct?Student*)a)->id
???????????((const?struct?Student*)b)->id);
???return?k;
}
int?ComparGrade(const?void?*a?const?void?*b)
{?
int?k?=?(((const?struct?Student*)a)->grade?>?
?????((const?struct?Stud
- 上一篇:用于解決著名的奶牛問題
- 下一篇:mysql udf 開發(封裝了reids操作)
評論
共有 條評論