摘要: Anorganic compoundis any member of a large class of chemical compounds whose molecules contain carbon. Themolar massof an organic compound is the mass... 阅读全文
posted @ 2015-06-08 23:55 Say舞步 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 来自:知乎链接:http://www.zhihu.com/question/31034164问题:什么才算是真正的编程能力?还在读书,也在实验室帮忙做了些东西,自己也搭过几个网站。在周围人看来似乎好像我很厉害,做了那么多东西,但是我发现这些东西虽然是我做的,但是实际上我手把手自己写的代码却并没有多少... 阅读全文
posted @ 2015-06-08 22:53 Say舞步 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Therefore, the score of ``OOXXOXXOOO" is 10 which is calculated by ``1+2+0+0+1+0+0+1+2+3".You are to write a program calculating the scores of test re... 阅读全文
posted @ 2015-06-08 22:50 Say舞步 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Some DNA sequences exist in circular forms as in the following figure, which shows a circular sequence ``CGAGTCAGCT", that is, the last symbol ``T" in... 阅读全文
posted @ 2015-06-08 21:14 Say舞步 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 1 函数重载概念函数重载(Function Overload)用同一个函数名定义不同的函数当函数名和不同的参数搭配时函数的含义不同2 函数重载的判断标准函数重载至少满足下面的一个条件:参数个数不同参数类型不同参数顺序不同3 函数返回值不是函数重载的判断标准两个难点:重载函数和默认函数参数混搭,重载函... 阅读全文
posted @ 2015-06-08 19:47 Say舞步 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 可以将占位参数与默认参数结合起来使用意义:为以后程序的扩展留下线索 兼容C语言程序中可能出现的不规范写法demo//C++可以声明占位符参数,占位符参数一般用于程序扩展和对C代码的兼容int func(int a, int b, int = 0){ return a + b;}void main()... 阅读全文
posted @ 2015-06-08 19:33 Say舞步 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 函数占位参数 占位参数只有参数类型声明,而没有参数名声明一般情况下,在函数体内部无法使用占位参数demo#include using namespace std;//函数占位参数,函数调用时,必须写够参数int func(int a, int b, int){ return a + b;}int m... 阅读全文
posted @ 2015-06-08 19:27 Say舞步 阅读(321) 评论(0) 推荐(0) 编辑
摘要: 1C++中可以在函数声明时为参数提供一个默认值,当函数调用时没有指定这个参数的值,编译器会自动用默认值代替void myPrint(int x = 3){ printf("x:%d", x);}2函数默认参数的规则只有参数列表后面部分的参数才可以提供默认参数值一旦在一个函数调用中开始使用默认参数值,... 阅读全文
posted @ 2015-06-08 19:24 Say舞步 阅读(232) 评论(0) 推荐(0) 编辑
摘要: demo//带参数的宏#define MYFUNC(a, b) ((a) 宏替换并展开 ((++a) < (b) ? (++a) : (b)) //a=3 b=3 c=3 printf("a = %d\n", a); printf("b = %d\n", b); printf("c = %d\n... 阅读全文
posted @ 2015-06-08 19:17 Say舞步 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 在C++中可以声明const引用const Type& name = var;const引用让变量拥有只读属性const int &a = bconst int &a = 10;Case1:#include using namespace std;//常引用的知识架构int main(){ //普通... 阅读全文
posted @ 2015-06-08 18:51 Say舞步 阅读(186) 评论(0) 推荐(0) 编辑
摘要: C++引用使用时的难点:当函数返回值为引用时若返回栈变量不能成为其它引用的初始值不能作为左值使用若返回静态变量或全局变量可以成为其他引用的初始值即可作为右值使用,也可作为左值使用C++链式编程中,经常用到引用,运算符重载专题demo#include using namespace std;//返回值... 阅读全文
posted @ 2015-06-08 16:11 Say舞步 阅读(2906) 评论(0) 推荐(2) 编辑
摘要: 1)引用作为其它变量的别名而存在,因此在一些场合可以代替指针2)引用相对于指针来说具有更好的可读性和实用性引用本质思考:思考1:C++编译器背后做了什么工作?#include using namespace std;int main(){ int a = 10; // 单独定义的引用时,必须初始化;... 阅读全文
posted @ 2015-06-08 15:26 Say舞步 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 普通引用在声明时必须用其它的变量进行初始化,引用作为函数参数声明时不进行初始化demo//复杂数据类型的引用#include using namespace std;struct Teacher{ char name[64]; int age;};void printfT(Teacher *pT){... 阅读全文
posted @ 2015-06-08 15:14 Say舞步 阅读(241) 评论(0) 推荐(0) 编辑
摘要: For a positive integerN, the digit-sum ofNis defined as the sum ofNitself and its digits. WhenMis the digitsum ofN, we callNageneratorofM.For example,... 阅读全文
posted @ 2015-06-08 14:54 Say舞步 阅读(200) 评论(0) 推荐(0) 编辑
摘要: MasterMind is a game for two players. One of them,Designer, selects a secret code. The other,Breaker, tries to break it. A code is no more than a row ... 阅读全文
posted @ 2015-06-08 14:41 Say舞步 阅读(157) 评论(0) 推荐(0) 编辑
摘要: A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string"ABCDEDCBA"is a palindrome because... 阅读全文
posted @ 2015-06-08 00:12 Say舞步 阅读(139) 评论(0) 推荐(0) 编辑