余张的故事 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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 腾讯企业邮箱邮件可以恢复么
    • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
    • ¥15 错误 LNK2001 无法解析的外部符号
    • ¥50 安装pyaudiokits失败
    • ¥15 计组这些题应该咋做呀
    • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
    • ¥15 让node服务器有自动加载文件的功能
    • ¥15 jmeter脚本回放有的是对的有的是错的
    • ¥15 r语言蛋白组学相关问题
    • ¥15 Python时间序列如何拟合疏系数模型