- 博客(26)
- 收藏
- 关注
原创 1005
#include #include using namespace std; typedef vector IntV; int sectorVector(int A,int B,int num) { IntV vecF(50,0); vecF[1] = 1; vecF[2] = 1; for(int i = 3;i != 49;i++) { vecF
2012-10-25 21:06:26
285
原创 面试小问题
#include #include #include using namespace std; void sort_t(int *a,int mid,int end) { for(int i = mid;i!= end;i++) { if(a[i]>a[i+1]) { int tmp = a[i]; a[i]=a[i+1]; a[i+
2012-09-17 22:19:25
366
原创 判断是否是素数
#include #include using namespace std; bool judge(int test) { if(test <= 0 ) return 0; double sqrtm = sqrt(test * 1.0); int i=1; while(i<sqrtm) { if(test%2 !=
2012-09-08 20:45:58
657
原创 1004
#include #include #include using namespace std; typedef map Type; string findcolor(Type &color) { int max = 0; string c; Type::iterator it; for(it = color.begin();it!= color.end();it++
2012-08-16 23:00:49
285
原创 1003
#include using namespace std; int main() { int a[100002]; int time; cin>>time; int num=1; while(time>0) { int count,i=1; cin>>count; int sum=0,max=-1001; int tmp_begin=1
2012-08-06 21:17:26
266
原创 1002
#include #include #include using namespace std; char inttochar(int tmp) { return tmp+48; } int chartoint(char tmp) { return tmp-48; } int main() { string first,second,sum; int time; i
2012-07-18 22:45:01
314
原创 question
causeVector.push_back(std::tr1::make_tuple( Protocol::GSM_MAP, tcap::TCAP_ERROR_CODE, static_cast(item.errorCode )) );
2012-07-17 10:37:51
302
原创 quesion
const CauseVector& ParserInstance::getCauseVector() const { if (causeVector_.size()==0 && getCause()!=INVALID_CAUSE) { causeVector_.push_back(std::tr1::make_tuple(getProtocolId(), getCauseType
2012-07-17 10:34:47
345
原创 1001
#include using namespace std; int main() { int a; while(cin>>a) { int sum=0; for(int i=0;i<a+1;i++) {sum+=i;} cout<<sum<<endl; cout<<endl; } } //wrong 其中,a*a+1 可能数据溢出。 #include
2012-06-26 16:47:50
278
原创 1000
//accept#include using namespace std; int main() { int a,b; while(cin>>a>>b) { cout<<a+b<<endl; } }
2012-06-26 15:08:20
290
原创 关于专业的碎碎念
看了视觉追踪的算法,突然觉得,设计模式是一维的,建模是三维的。差的不只是一个数量级。 通俗来说,现在的水平顶多算是二次函数,建模是立体方程...
2012-06-04 17:17:07
270
原创 关于生活的碎碎念
总结一个我的特点,不喜欢长时间的讨论,我喜欢简短的讨论会议。简明介绍,针对重点的讨论。如果暂时没有解决办法就各自回去想明白了再来... 这算是优点还是缺点....我不知道....
2012-05-31 17:22:18
544
原创 关于指针字符串
对于指针指向的字符串,"如果试图修改字符串的内容, 结果将不确定". 我的理解是: 指针指向的字符串类似一个常量, 你可以修改指针,让它指向不同的字符串, 但不可以修改字符串的内容. 例如: int main() { char *a="i am a student\n"; int m=0; a[m]='n'; getchar(); } 会报错
2012-05-23 09:59:54
500
原创 反转字符串
1.C++ string 使用 reverse_iterator,rbegin and rend;原字符串不变,只是输出。 #include #include using namespace std; int main() { string tmp("abcdefg"); string::reverse_iterator tmp_it=tmp.rbegin(); f
2012-05-22 15:15:53
368
原创 string 的构造函数
1. string ( const char * s ); Content is initialized to a copy of the string formed by the null-terminated character sequence (C string) pointed bys. The length of the character sequence is determ
2012-05-22 14:06:14
517
原创 有关生活的碎碎念
爹妈给我起名字,意为寻找他们未实现的梦; 张歆艺,也是爸爸妈妈有他们的梦想,希望歆艺去实现。 闭眼想了下,我的孩子叫神马?房子?车?还是百万年薪??? 或者,直接叫序员? 唔...... 真恐怖~
2012-05-19 10:13:01
400
原创 有关生活的碎碎念
没到35岁之前,我不希望给我贴上某某背景的标签。我还有很多种转行跳槽的可能,我现在做通信,明天可以做前端,后天还可以做手机应用。别给年轻人贴标签,年轻就有无限种可能。 老罗现在做手机,成功了就是混搭跨界的榜样,不成功拍拍屁股再站起来,还是个不屈不挠最求梦想的猛人。
2012-05-17 15:56:57
586
原创 switch 与case标号
#include using namespace std; class fun { public : fun():w(0){} fun(int t):w(t){} int getcalue(){return w;} private : int w; }; int main() { class fun Fun(6); //若在
2012-05-16 14:13:38
585
原创 missing break in switch.
while() { switch() { case 1: switch() { case 2: break;
2012-05-16 14:11:11
409
转载 9 reasons to start using C++11
http://www.cpprocks.com/2012/05/07/9-reasons-to-start-using-c11/ http://news.10jqka.com.cn/20120514/c527647871.shtml
2012-05-15 16:48:56
200
转载 bool 和BOOL的区别
一、 1、类型不同 BOOL为int型 bool为布尔型 2、长度不同 bool只有一个字节 BOOL长度视实际环境来定,一般可认为是4个字节 3、取值不同 bool取值false和true,是0和1的区别 BOOL取值FALSE和TRUE,是0和非0的区别 二: bool是标准C++数据类型,可取值true和false。单独占一个字节, 如果数个b
2012-05-08 10:14:34
289
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅