C语言知识程序设计连连看.doc
《C语言知识程序设计连连看.doc》由会员分享,可在线阅读,更多相关《C语言知识程序设计连连看.doc(12页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。
1、.#include #include #include #include #include using namespace std; #include int mai() /倒计时 for (int i=3; i=0; i-) long t = time(NULL); for(;) long n = time(NULL); if(n != t) break; system(cls);cout endl;cout endl;cout 离史上最卡哇依的游戏开始还有* i *秒哦!endl; return 0; void init1(); void print1(); int exit1();voi
2、d init2();void print2();int exit2();void init3();void print3();int exit3();void near1(int a,int b,int a1,int b1); char chessman1010; void main() /主函数 time_t start,end,time; start=clock();mai();int d;cout endl;cout endl;cout endl;cout *endl; cout *endl; cout *亲,请选择适合您智商的级别:1低级 2中级 3登峰造极 *endl;cout *e
3、ndl; cout *endl;cout endl;cout endl;cout 研发小组:Q Y Qendl; coutd;cout -* endl;system(pause);switch(d)case 1:init1();break;case 2:init2();break; case 3:init3();break;default :cout你个逗比;int op; int row,line; int row2,line2; do if(d=1) print1(); else if(d=2) print2(); else if(d=3) print3(); printf(options
4、:n); printf(t1.selectn); printf(t2.restartn); printf(t3.sortn); scanf(%d,&op); if(op=1) printf(不造亲第一个相中了谁呢:); scanf(%d %d,&line,&row); printf(再给他找个伴儿吧,亲:); scanf(%d %d,&line2,&row2); if(chessmanlinerow!=chessmanline2row2) printf(有缘无分呐!n);system(pause); else if(line=line2&row=row2) printf(有搞错哦,亲!n);s
5、ystem(pause); else if(line=line2) near1(line,row,line2,row2); else near1(line2,row2,line,row); if(op=2) if(op=3) main(); while(exit1(),exit2(),exit3(); system(pause); printf(nnntt哇呀!你好厉害!n); end=clock(); time=end-start; /这里的时间是计算机内部时间 cout endl time: time endl;system(pause); cout本次得分:98分! 继续保持哦!endl
6、; system(pause);void init1() /4乘4矩阵 int i,j; int a4=0; srand(time(NULL); for(i=1;i4;i+) for(j=1;j5;j+) chessmanij=rand()%4+65; if(chessmanij=65) a0+; if(chessmanij=66) a1+; if(chessmanij=67) a2+; if(chessmanij=68) a3+; for(i=0;i4;i+) if(ai%2!=0) chessman4i+1=i+65; else chessman4i+1=69; void print1()
7、 int i,j; system(cls); printf(t 1 2 3 4n); for(i=0;i5;i+) printf(tnt); for(j=0;j5;j+) printf(%4c,chessmanij); if(j=4&i!=0&i!=5)printf(t%d,i); printf(nnnn); int exit1() int i,j; for(i=0;i6;i+) for(j=0;j6;j+) if(chessmanij!=0) return 1; return 0; void init2() /6乘6矩阵 int i,j; int a6=0; srand(time(NULL)
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 语言 知识 程序设计 连连
限制150内