上一页 1 ··· 81 82 83 84 85 86 87 88 89 ··· 95 下一页
摘要: #include <vector>#include <iostream>#include "compacket.h"#include <map>using namespace std;struct Activity{int m_nStep;int m_nCount;Activity():m_nStep(1),m_nCount(0){}Activity(const int nStep,const int nCount):m_nStep(m_nStep = nStep),m_nCount(m_nCount = nCount){}};int m 阅读全文
posted @ 2012-05-18 17:01 byfei 阅读(184) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2012-05-17 15:34 byfei 阅读(28) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;class A{public:A(double _data = 0.0) :data(_data){}A& operator =(const A& rhs){data = rhs.data;return *this;}friend A operator +(const A& lhs, const A& rhs);friend A operator -(const A& lhs, const A& rhs);friend A operator *(const 阅读全文
posted @ 2012-05-15 19:12 byfei 阅读(166) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;class A{public: A(double _data = 0.0) : data(_data) { } A& operator =(const A& rhs) { da... 阅读全文
posted @ 2012-05-15 19:12 byfei 阅读(34) 评论(0) 推荐(0) 编辑
摘要: void str(char * a){char *toks = " ";char * tok = strtok(a, toks);while (tok){if (tok == a)strcpy(a, tok);elsestrcat(a, tok);tok = strtok(NULL, toks);}}int main(){string b = "this is a dog";str(const_cast<char*>(b.c_str()));cout<<b;return 0;}#include <iostream> # 阅读全文
posted @ 2012-05-15 15:29 byfei 阅读(465) 评论(0) 推荐(0) 编辑
摘要: #include <vector>#include <iostream>#include "compacket.h"using namespace std;char szBuf[4096];const int INT = 4;const int STRING = 100;void EncodeMsg(char *pPos){int tmp = 80000;memcpy((void *) pPos, (void *) &tmp, INT);pPos+=INT;char Role[] = "艾迪";memcpy((void * 阅读全文
posted @ 2012-05-14 16:57 byfei 阅读(181) 评论(0) 推荐(0) 编辑
摘要: #include <vector>#include <iostream>#include <iterator>using namespace std;int main(){int N = 2, M = 3;vector<vector<int> > Matrix(N, vector<int> (M, 0));ostream_iterator<int> os(cout, " ");Matrix[0][2] = 4;//交换矩阵的两行Matrix[0].swap(Matrix[1]);//交换矩阵 阅读全文
posted @ 2012-05-14 14:49 byfei 阅读(1362) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <string.h>using namespace std;int main(){unsigned char input[50];cin >> input;int flag = 0;for (int i = 0; i < 50; i++){if (input[i] > 0xa0 && input[i] != 0){if (flag == 1){cout << "chinese character" << endl;flag = 0; 阅读全文
posted @ 2012-05-12 09:47 byfei 阅读(189) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <string.h>using namespace std;int main(){string result;string s ( "AAAAAAAA" );char ch = 'C';result = s.replace ( 1 , 3 , 4 , ch ); // s= "ACCCCAAAAcout<<s<<endl;return 0;} 阅读全文
posted @ 2012-05-11 19:17 byfei 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 1. 《代码大全》史蒂夫·迈克康奈尔推荐数:1684“优秀的编程实践的百科全书,《代码大全》注重个人技术,其中所有东西加起来,就是我们本能所说的“编写整洁的代码”。这本书有50页在谈论代码布局。” —— Joel Spolsky对于新手来说,这本书中的观念有点高阶了。到你准备阅读此书时,你应该已经知道并实践过书中99%的观念。– esac2. 《程序员修炼之道》推荐数:1504对于那些已经学习过编程机制的程序员来说,这是一本卓越的书。或许他们还是在校生,但对要自己做什么,还感觉不是很安全。就像草图和架构之间的差别。虽然你在学校课堂上学到的是画图,你也可以画的很漂亮,但如果你觉得你不太 阅读全文
posted @ 2012-05-08 21:50 byfei 阅读(142) 评论(0) 推荐(0) 编辑
上一页 1 ··· 81 82 83 84 85 86 87 88 89 ··· 95 下一页