c++错误问题

来源:百度知道 编辑:UC知道 时间:2024/05/17 22:22:43
我的c++程序不能显示错误,而我有找不出来其中的一个错误,请各位帮忙!

#include "iostream.h"
#include "stdlib.h"
#include "time.h"
int main()
{
int a,b,numQ=0,numR=0;
char inquire;
srand(time(NULL));
cout<<"***Dizem算数天地***"<<endl;
do
{
int temp=rand()%2;
a=rand()%100;
b=rand()%100;
switch(temp)
{
case0 :
{
int ans;
cout<<a<<'+'<<b<<'=';
cin>>ans;
if (ans==a+b)
{
numR++;
cout<<"恭喜啊!答对了!"<<endl;
}
else cout<<"算错了,你好笨!"<<endl;
break;
}
case1 :
{
int ans;
cout<<a<<'-'<<b<<'=';
cin>>ans;
if (ans==a-b)
{
numR++;
cout<<"恭喜啊!答对了!"<<endl;

#include "iostream.h"
#include "stdlib.h"
#include "time.h"
int main()
{
int a,b,numQ=0,numR=0;
char inquire;
srand(time(NULL));
cout<<"***DizemËãÊýÌìµØ***"<<endl;
do
{
int temp=rand()%2;
a=rand()%100;
b=rand()%100;
switch(temp)
{
case 0 :
{
int ans;
cout<<a<<'+'<<b<<'=';
cin>>ans;
if (ans==a+b)
{
numR++;
cout<<"¹§Ï²°¡£¡´ð¶ÔÁË£¡"<<endl;
}
else
cout<<"Ëã´íÁË£¬ÄãºÃ±¿£¡"<<endl;
break;