140809暑期培训

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;
   }


2、对于某些题给定了你要求变量的范围,在写好程序之后千万记得将所给范围的最大值代入
   程序试一下,看看是否会超出int的的范围,假设超出int范围,则改成__int64,%I64d。
原文地址:https://www.cnblogs.com/hrhguanli/p/4491795.html