摘要: 程序设计俱乐部看到的:自己又想了想,代码也比较简单吧:#include<iostream>using namespace std;int fun(int a=0,int b=5){ return (a+b);}bool bad(int a,int b,int c){ return a+b<c;}int main(){ for (int c=1; c<50; c++) { for (int b=1; b<100; b++) { for (int a = b>c?(b+1):(c+1); a<100; a++) { if (bad(c,b,a)) brea 阅读全文
posted @ 2011-03-09 20:15 hailong 阅读(397) 评论(0) 推荐(0) 编辑
摘要: string str1 = "123"; string str2 = str1;str1 = "456";cout << "str1 = " << str1 << endl // 輸出 456 << "str2 = " << str2 << endl << endl; // 輸出 123也就是说str1改变,str2并不改变,如果想str1与str2享用同一个字符串空间可以这么改一下: string str1 = "123 阅读全文
posted @ 2011-03-09 09:06 hailong 阅读(215) 评论(2) 推荐(0) 编辑