c语言代码有一行未执行,新手求助,程序执行时有部分代码未执行,是怎么回事?...

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

一下是源代码,刚开始自己做的,但一直出现问题(无报错),所以直接复制的答案,然后用gcc -std=c99 -O3 -Wall进行编译,但问题依旧,所以只能向高手求助了。这是一个猜数字的游戏,开始时,游戏会输出2个随机数字,停留1秒,然后删除,等待用户输入正确数字。

/* Program 4.12 Simple Simon */

#include                       /* For input and output    */

#include                       /* For toupper() function */

#include                     /* For bool, true, false   */

#include                      /* For rand() and srand() */

#include                        /* For time() and clock() */

int main(void)

{

char another_game = 'Y';

int correct = false;

int counter = 0;

int sequence_length = 0;      /* Number of digits in a sequence         */

time_t seed = 0;              /* Seed value for random number sequence */

int number = 0;               /* Stores an input digit                  */

time_t now = 0;             /* Stores current time - seed for random values   */

int time_taken = 0;         /* Time taken for game in seconds                 */

printf("\nTo play Simple Simon, ");

printf("watch the screen for a sequence of digits.");

printf("\nWatch carefully, as the digits are only displayed"

" for a second! ");

printf("\nThe computer will remove them, and then prompt you ");

printf("to enter the same sequence.");

printf("\nWhen you do, you must put spaces between the digits. \n");

printf("\nGood Luck!\nPress Enter to play\n");

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值