1、 CCİ 2114710131619𣬽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