void random2(int &a,int &b)    //产生两位随机数
{
     time_t t;                     //时间变量
        srand((unsigned)time(&t));  //种下随即发生器必须的种子
        a=rand()%100;
  b=rand()%100;
      
}
int add(int& a,int& b)  //加法运算
{  
 int i,p,r,c;
    i=a;p=b;
 r=i+p;
 cout<<"请计算"<<i<<"+"<<p<<"的结果为:";
 cin>>c;
 if(c!=r) 
 {
  cout<<"计算结果不正确,还需要努力!"<<endl;
  cout<<"正确的结果为:"<<r<<endl;
 }
 else count++;
return 1;
原文请找腾讯752018766辣,文-论'文.网http://www.751com.cn 
 r=i-p;
 cout<<"请计算"<<i<<"-"<<p<<"的结果为:";
 cin>>f;
 if(f!=r) 
 {
  cout<<"计算结果不正确,还需要努力!"<<endl;
  cout<<"正确的结果为:"<<r<<endl;
 }
 else count++;
return 1;
}
int cheng(int &a,int &b)   //乘法运算
{ 
 int i,p,r,f;
    i=a;p=b;
 r=i*p;
 cout<<"请计算"<<i<<"*"<<p<<"的结果为:";
 cin>>f;
 if(f!=r) 
 {
  cout<<"计算结果不正确,还需要努力!"<<endl;
  cout<<"正确的结果为:"<<r<<endl;
 }
 else count++;
return 1;
}
int chu(int &a,int &b)   //除法运算
{
 float i,p,f;
 float r;
    i=a;p=b;  
 r=i/p;
    cout<<"请计算"<<i<<"/"<<p<<"的结果为:";
 cin>>f;
 if(f!=r) 
 {
  cout<<"计算结果不正确,还需要努力!"<<endl;
  cout<<"正确的结果为:"<<r<<endl;
 }
 else count++;
return 1;