skylove888888的一个game:编了一个数字魔术的小程序

来源:互联网 发布:阿里云域名前面是什么 编辑:程序博客网 时间:2024/04/27 23:45
#include <stdio.h>
#include <stdlib.h>


int main() {


printf("######### MAGIC GAME #########\n");


int G1[6][30] = {
{ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59 },
{ 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 31, 34, 35, 36, 39, 42, 43, 46, 47, 50, 51, 54, 55, 58, 59 },
{ 4, 5, 6, 7, 12, 13, 14, 15, 20, 21, 22, 23, 28, 29, 30, 31, 36, 37, 38, 39, 44, 45, 46, 47, 52, 53, 54, 55, 60 },
{ 8, 9, 10, 11, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31, 40, 41, 42, 43, 44, 45, 46, 47, 56, 57, 58, 59, 60 },
{ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60 },
{ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60 }
};


printf("\n");
printf("Please guess a number called 'BIG BONG' form 1 to 60 in your heart!\n");


printf("\n");


static int BIG_BONG = 0;
int choice;


for (int i = 0; i<6; i++){


printf("\n");
printf("the BIG BONG in these numbers?\n");
printf("==============================\n");
for (int j = 0; j<30; j++)
printf("%d, ", G1[i][j]);
printf("\n");
printf("==============================\n");
printf("Yes:1   No:2 \n");
printf("\n");


scanf_s("%d", &choice);
if (choice == 1){
BIG_BONG += G1[i][0];
continue;
}
else if (choice == 2){
BIG_BONG += 0;
continue;
}
else
break;
}




printf("BIG BONG is: %d\n", BIG_BONG);


printf("#########  GAME End #########\n");




system("PAUSE");


return 0;


}
0 0
原创粉丝点击