![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
想法
小xu子
开心地过日子
展开
-
字符串排序(sort)
其实这个跟普通的sort一样,只不过在重写cmp的时候,用字符串比较函数去处理 #include #include #include #include #include #define MAX 100 using namespace std; string node[MAX]; bool cmp(string a,string b) { return a.compare(b)<1; } int原创 2017-05-29 09:59:33 · 3005 阅读 · 0 评论 -
hdu 1004 字符串排序
代码比较简单,直接看代码 #include #include #include #include #include #define MAX 1005 using namespace std; string node[MAX]; bool cmp(string a,string b) { if(a.length()==b.length()) return a.compare原创 2017-05-29 10:27:27 · 263 阅读 · 0 评论 -
杂烩
变量赋值只能在函数内进行(不是初始化), 例如 #include #include using namespace std; int num; num=1; int main() { cout return 0; } 这样是不行的 但是你可以这样,如下: #include #include using namespace std; in原创 2017-07-19 15:10:14 · 217 阅读 · 0 评论