摘要: 练习代码: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 struct cmp 8 { 9 // 重载operator()10 // 注意:compare函数的参数必须写成const类型,否则无法编译通过11 // 这里是有意使string按字典序的反序排列12 bool operator()(const string& str1, const string& str2)13 {14 return str1>str2;15 }... 阅读全文
posted @ 2013-09-21 19:08 铁甲小宝 阅读(174) 评论(0) 推荐(0)
摘要: 可以看出来,32位有符号整数可表示的最大数大于20亿,32位无符号整数可表示的最大数大于40亿,因此,碰上十几亿的海量数据处理时,不要慌~~ 1 // 在32位系统中 2 // int的范围是[-2147483648,2147483647] 3 // unsigned int的范围是[0,4294967295] 4 const unsigned int min_uint = 0; 5 const unsigned int max_uint = 4294967295; 6 const int min_int = -(int)2147483648; 7 const int max_int = (i 阅读全文
posted @ 2013-09-21 15:04 铁甲小宝 阅读(2397) 评论(0) 推荐(0)