标签:style ar size har 程序 字符串 on algorithm
1、用sort对结构体中字符串进行二级排序 #include<string.h>
#include<algorithm>
using namespace std;
struct s
{
int d;
char c[10];
}ss[15];
bool cmp(s a,s b)
{
if(strcmp(a.c,b.c)!=0)
return strcmp(a.c,b.c)<0;
else
return a.d<b.d;
}标签:style ar size har 程序 字符串 on algorithm
原文地址:http://blog.csdn.net/wangluoershixiong/article/details/38485447