调试了一天 总是出现fatal error C1004: unexpected end of file found
这样的错误提示 错误出现的地方在程序最后一行的下边几行 大家帮我一下吧
我是个菜鸟 谢谢大家了
程序如下:
#include"iostream.h"
#include"stdlib.h"
#include"time.h"
int main()
{
int a,b,numuse=0,numright=0;
srand(time(NULL));
cout<<"***欢迎你来做一位数的加减乘除法***"<<endl;
do
{
char inquiry;
int temp;
temp=rand()%4;
a=rand()%10;
b=rand()%10;
switch(temp)
{
case 0:
{
int ans;
cout<<a<<'+'<<b<<'=';
cin>>ans;
if(ans==a+b)
{
cout<<"答对了!"<<endl;
numright=numright+1;
}
else
{
cout<<"答错了!"<<endl;
}
break;
}
case 1:
{
int ans;
cout<<a<<'-'<<b<<'=';
cin>>ans;
if(ans==a-b)
{
cout<<"答对了!"<<endl;
numright=numright+1;
}
else
{
cout<<"答错了!"<<endl;
}
break;
}
case 2:
{
int ans;
cout<<a<<'*'<<b<<'=';
cin>>ans;
if(ans==a*b)
{
cout<<"答对了!"<<endl;
numright=numright+1;
}
else
{
cout<<"答错了!"<<endl;
}
break;
}
case 3:
{
int ans;
if(b!=0)
{
if(a%b!=0&&a<b)
{
cout<<"从新选题"<<endl;
continue;
}
cout<<a<<'/'<<b<<'=';
cin>>ans;
if(ans==a/b)
{
cout<<"答对了!"<<endl;
numright=numright+1;
}
else
{
cout<<"答错了!"<<endl;
}
}
else
{
continue;
}
break;
}
numuse=numuse+1;
cout<<"是否再做一道题?(否的话按N或n)";
cin>>inquiry;
}while(inquiry!='N'&&inquiry!='n');
cout<<"你的正确率为"<<numright*100/numuse<<'%'<<endl;
return 0;
}
此处为点击程序出错的那句话后 蓝色小箭头指向的位置