收藏 分享(赏)

C语言编写的游戏.txt

上传人:Wallisgabriel 文档编号:21759360 上传时间:2024-04-22 格式:TXT 页数:6 大小:4.74KB
下载 相关 举报
C语言编写的游戏.txt_第1页
第1页 / 共6页
C语言编写的游戏.txt_第2页
第2页 / 共6页
C语言编写的游戏.txt_第3页
第3页 / 共6页
C语言编写的游戏.txt_第4页
第4页 / 共6页
C语言编写的游戏.txt_第5页
第5页 / 共6页
亲,该文档总共6页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

1、 CCİ 21󽫵14710131619𣬽25811141720𣬽棬11 0 2 qiucp green apple : 787 24412 2009-02-20 15:22:091 :0 C/C+ code/ pukepai.cpp : /#include stdafx.h#include #include #define N 100 #define M 21 void swapnum(int n, int m) int tmp = 0; tmp = n; n = m; m = tmp; return;void randnum(const in

2、t *psrc, int *pdst) int u =0; int i = 0; int p = 0; for(i=0; i= 1) tmpj = ptri; i = i-3; j+; i = 18; while (i = 0) tmpj = ptri; i = i-3; j+; i = 20; while (i = 2) tmpj = ptri; i = i-3; j+; else if (2 = num) i = 18; j = 0; while (i =0) tmpj = ptri; i = i-3; j+; i = 19; while (i =1) tmpj = ptri; i = i

3、-3; j+; i = 20; while (i =2) tmpj = ptri; i = i-3; j+; else i = 18; j = 0; while (i =0) tmpj = ptri; i = i-3; j+; i = 20; while (i =2) tmpj = ptri; i = i-3; j+; i = 19; while (i =1) tmpj = ptri; i = i-3; j+; /copy to ptr for (i = 0; i21; i+) ptri = tmpi; return;int _tmain(int argc, _TCHAR* argv) int

4、 numM = 0; int tmpN = 0; int i = 0; int j = 0; char ch = 0; int group = 0; int question = 0; /create tmp numbers for (i = 0; iN; i+) tmpi = i+1; randnum(tmp, num); /print 21 numbers printf(The 21 numbers:n); for (i = 0; i21; i+) printf(%d ,numi); /choose a number printf(nNow you can choose a number

5、and press enter key); scanf(%c, &ch); for (question = 0; question 3; question+) printf(ngroup resultn); j = 0; while (j 3) i = j; while(i21) printf(%d , numi); i = i+3; printf(n); j+; /answer the question printf(Now answer the %d question, tell me which group the number is?n, question+1); scanf(%d,

6、&group); scanf(%c, &ch); /deal with the result switch (group) case 1: compositor(num, 1); break; case 2: compositor(num, 2); break; case 3: compositor(num, 3); break; default: printf(Warning: you input is error!n); break; printf(nNow i can tell you the following num is you choosed:n); printf(%d, num10); scanf(%c, &ch); return 1; funfunqi , : 57 125958 2009-02-20 21:48:212 :0 AI

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 高中资料

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:文库网官方知乎号:文库网

经营许可证编号: 粤ICP备2021046453号世界地图

文库网官网©版权所有2025营业执照举报