[C]数字炸弹小游戏

数字炸弹

使用的是C语言


# 内容
#include<stdio.h>
#include<stdlib.h>
int main(){
   
    //变量
    char c_TheRequest = 1;//开始界面的字符
    int in_Deltar = 1,in_EnteredNumber,in_Sig;//游戏中输入数字及其判定所需要的数字
    int in_GivenNum = 0,in_An = 0,in_Bn = 0;//出的数字,和数字区间
    int in_Mid1,in_Mid2;//用来交换An、Bn的值以满足An<Bn的中间量
    int in_DistantAn,in_DistantBn;//An与Bn离num的距离
    int in_TemporaryAnSaver,in_TemporaryBnSaver;//临时用于比较的An、Bn储存器
    
    //开始界面
    printf("If you just happen to open the game and do not have the intention to play it.\n");
    printf("You can enter a q to quit or you can enter an s to start the game now!\n");
    scanf("%c",&c_TheRequest);
    getchar();
    while (c_TheRequest != 's' && c_TheRequest != 'q'){
   
        printf("Please do not enter a irrelevant letter.\n");
        scanf("%c",&c_TheRequest);
        getchar();
    }
    if(c_TheRequest == 'q'){
   
        printf("So sad then.Hope you can play with me next time.\n");
        getchar();
    }

    //游戏
    if(c_TheRequest == 's'){
   
        
        //输入“数字炸弹”
        system("cls");
        printf("(^ o ^) # *** NOW LET\'S PLAY! *** # (^ o ^)\nAttention!You can only enter numbers in the following steps.\nEnter to start.\n");
        getchar();
        
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值