#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time>
main ()
{
char cho;
int yes=1;
double start,finish,elapsed;
int data,count,goal,c;
while( yes )
{
srand(time(0));
goal=rand() %100;
count=0;
start=(double)clock();
printf ("欢迎进入猜数游戏!");
printf("请输入你猜的数字!\n");
scanf("%d",&data);
while(data!=goal)
{
if (data>goal)
{
printf("您猜的数有些大,请耐心重输入!\n");
count++;
}
else
{
printf("您猜的数有些小,请耐心重输入!\n");
count++;
}
scanf("%d",&data);
}
printf("真聪明,祝贺!");
printf("您猜的次数: %d\n",count);
finish =(double)clock();
elapsed=finish- start;
printf("您所用的时间: %f ms\n", elapsed);
}
}
我用VC6.0提示我Cannot open include file: 'time': No such file or directory
Error executing cl.exe. 高手们帮我改下,谢谢了