CSDN博客

img 98764321

vc++中的错误,请大哥大姐指教,谢!

发表于2004/7/10 8:53:00  565人阅读

这是我在其它网站看到的例子,#include<stdio.h>
#include<stdlib.h>
#include<time.h>

void guitu(void);

main()
{
srand(time(NULL));
guitu();
return 0;
}

void guitu()
{
int i,j,count=0,cou=0,number;
char printfun[71];

while(1) {
for(j=0;j<70;j++)
printfun[j]=' ';
printfun[71]='';

number=rand()%10+1;
printf("n");

if(1<=number && number<=5) {
count=count+3;
if(count>70) count=0;
printfun[count]='G';
}

if(6<=number && number<=7) {
count=count-6;
if(count<0) count=0;
printfun[count]='G';
}

if(8<=number && number<=10) {
count=count+1;
if(count>70) count=0;
printfun[count]='G';
}

if(1<=number && number<=2) {
cou=cou+0;
printfun[cou]='T';
}

if(3<=number && number<=4) {
cou=cou+9;
if(cou>70) cou=0;
printfun[cou]='T';
}

if(number==5) {
cou=cou-12;
if(cou<0) cou=0;
printfun[cou]='T';
}

if(6<=number && number<=8) {
cou=cou+1;
if(cou>70) cou=0;
printfun[cou]='T';
}

if(9<=number && number<=10) {
cou=cou-2;
if(cou<0) cou=0;
printfun[cou]='T';
}

if(count==cou)
printfun[count]='P';

printf("%s",printfun);
printf("nn");

if(count==70) {
printf("gui win!!!nn");
break;
}
if(cou==70) {
printf("tu win!!!nn");
break;
}
sleep(1);
}
}

这是C的例子,在VC++中出现了错误如下:

fatal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.

这是什么错误,请指点,谢!

0 0

相关博文

我的热门文章

img
取 消
img