摘要: I know you know the meaning of this word.I'm not calling you to excuse the meaning of this word.Just at that moment ,I saw the diary written by shinny(prbably this name),to be frank, I like it .it's pretty nice.Easy to know,and I also saw the lap between she and me !A long time ago ,I insist 阅读全文
posted @ 2013-07-22 19:29 缺少主人公 阅读(315) 评论(0) 推荐(0)
摘要: 看之前写过的一些代码和文章,感觉自己写的注释太少了,不利于别人,也不利于自己看。以后盖掉坏习惯,多多的天假注释。也坚持把自己掌握的东西,写出来说出来,这样才是自己的嘛。 加油。。你们也是。 阅读全文
posted @ 2013-05-08 18:04 缺少主人公 阅读(122) 评论(0) 推荐(0)
摘要: #include int fun(int n){int i = n;if(i==1){return 1;}else{return i*fun(i-1);}}void main(void){int n;scnaf("%d\n",&n);//注意n的值不要过大 不然。。你懂滴printf("%d\n",... 阅读全文
posted @ 2012-09-28 23:48 缺少主人公 阅读(170) 评论(0) 推荐(0)
摘要: #include <stdio.h>void move(int n, char a, char b,char c){if(n==1){printf("%c->%c\n",a,c);printf("%c->%c\n",a,c);printf("%c->%c\n",a,c);}else {move(n-1,a,c,b);move(1,a,b,c);move(n-1,b,a,c);}}void colorMove(int n){char a = 'A';char b = 'B'; 阅读全文
posted @ 2012-09-28 19:55 缺少主人公 阅读(417) 评论(0) 推荐(0)
摘要: #include//将n个盘子A->C借助Bvoid move(int n,char a,char b,char c){ if(n==1) { printf("%c->%c\n",a,c); printf("%c->%c\n",a,c); } else { move(n-1,a,c,b); prin... 阅读全文
posted @ 2012-09-27 21:03 缺少主人公 阅读(2320) 评论(0) 推荐(0)
摘要: #include "stdio.h"#include "time.h"#include "stdlib.h"int a[8];void Init(){ srand((unsigned)time(NULL)); int i = rand()%9-1; for(int j =0;j<8;j++) a[... 阅读全文
posted @ 2012-09-25 20:02 缺少主人公 阅读(284) 评论(0) 推荐(0)
摘要: 先贴一段代码来自于C++沉思录#include<iostream>using namespace std;int f(int){cout<<"f:a\t"<<10<<"lalla...\n";return 1;}void g(){cout<<"wocao"<<endl;}//建立类模板 Com_basetemplate<class G,class F>class Com_base{public:virtual F operator()(G)=0;vir 阅读全文
posted @ 2012-09-24 19:44 缺少主人公 阅读(205) 评论(0) 推荐(0)
摘要: 不管是宏定义还是内联都讲的是在程序编译时。宏定义是预处理器在代码优化时直接替换的,而内联函数是在编译期间插入代码.宏定义替换比内联函数执行得早-------------------------------------------------内联函数-------------------------------------------对于任何内联函数,编译器在符号表里放入函数的声明(包括名字、参数类型、返回值类型).如果编译器没有发现内联函数存在错误,那么该函数的代码也被放入符号表里.在调用一个内联函数时,编译器首先检查调用是否正确(进行类型安全检查,或者进行自动类型转换,当然对所有的函数都一样 阅读全文
posted @ 2012-09-22 22:35 缺少主人公 阅读(473) 评论(0) 推荐(0)
摘要: 就象大家更熟悉的const一样,volatile是一个类型修饰符(type specifier)。它是被设计用来修饰被不同线程访问和修改的变量。如果没有volatile,基本上会导致这样的结果:要么无法编写多线程程序,要么编译器失去大量优化的机会。volatile的作用: 作为指令关键字,确保本条指令不会因编译器的优化而省略,且要求每次直接读值.#include "stdio.h"/*volatile 指出 i是随时可能发生变化的,每次使用它的时候必须从i的地址中读取,因而编译器生成的汇编代码会重新从i的地址读取数据放在b中。而优化做法是,由于编译器发现两次从i读数据的代码 阅读全文
posted @ 2012-09-22 22:01 缺少主人公 阅读(305) 评论(0) 推荐(0)