#include<iostream>
using namespace std;
int main()
{
int i,a[30],b[30],m;
for(i=0;i<30;i++)
{
a[i]=rand()%100;
b[i]=rand()%100;
m=rand()%4;
if(m==0)
cout<<a[i]<<" + "<<b[i]<<"="<<endl;
if(m==1)
cout<<a[i]<<" - "<<b[i]<<"="<<endl;
if(m==2)
cout<<a[i]<<" * "<<b[i]<<"="<<endl;
if(m==3)
cout<<a[i]<<" / "<<b[i]<<"="<<endl;
}
return 0;
}
一寒假没怎么看,突然写程序有点紧张,思路也不对,本来用不到数组的,既然一开始思路这样就这样编吧。。继续努力吧,希望下次能当堂做出来。