余张的故事 2014-10-26 04:20 采纳率: 0%
浏览 4264

term does not evaluate to a function出现这个问题是怎么回事?实在不知道了。。。

#include "stdio.h"
#include "ctype.h"
#include "time.h"
#include "stdlib.h"
#define bool int
#define true 1
#define false 0
int main(void)
{
char game='Y';
unsigned int score=0;
unsigned int digits=0;
unsigned int time=0;
// unsigned i=0;
bool correct=0;
unsigned int delay=3;
clock_t start=0;
clock_t wait=0;
int number=0;
unsigned tries=0;
time_t seed=0;
printf("this is an interesting game:hhhh");
printf("please enter the game:");
do
{
tries=0;
correct=true;
digits=2;
start=clock();
while(correct)
{
// i=1;
++tries;
wait=clock();
srand(time(&seed));
for(unsigned int i=1;i<=digits;++i)
printf("%u",(rand()%10));
for(;(unsigned)clock()-wait<delay*CLOCKS_PER_SEC;)
printf("\r");
for(unsigned int j=1;j<=digits;++j)
printf(" ");
if(tries==1)
printf("dfkdjfkdjfkdfjkd");
else
printf("\r");
srand(seed);
for(unsigned int a=1;a<=digits;++a)
{
scanf("%u",&number);
if(number!=rand()/10)
{
correct=false;
break;
}
};
if(correct&&((tries%3)==0))
++digits;
printf("%s\n",correct? "correct!":"wrong!");
}

score=10*(digits-1);
time=((clock()-start)/CLOCKS_PER_SEC-delay*tries);
printf("the score is %u,and the time is %u",score,time);
fflush(stdin);
printf("do you want to play the game again?(y/n)");
scanf("%c",&game);
}
while(toupper(game));
return 0;
}

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 微信公众号自制会员卡没有收款渠道啊
    • ¥15 stable diffusion
    • ¥100 Jenkins自动化部署—悬赏100元
    • ¥15 关于#python#的问题:求帮写python代码
    • ¥20 MATLAB画图图形出现上下震荡的线条
    • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
    • ¥15 perl MISA分析p3_in脚本出错
    • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
    • ¥15 ubuntu虚拟机打包apk错误
    • ¥199 rust编程架构设计的方案 有偿