2 fututadeyoushang fututadeyoushang 于 2014.10.26 12:20 提问

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;
}

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!