四则运算随机题30道代码

时间:2016-03-06 19:21:10   收藏:0   阅读:219

 

#include<iostream.h>
#include<stdlib.h>
int main(){
int a ,b,c,i;
for(i=0;i<30;i++){
a=rand()%100;
b=rand()%100;
c=rand()%4;
if(c==0)
cout<<a<<"+"<<b<<"="<<endl;
else if(c==1)
cout<<a<<"-"<<b<<"="<<endl;
else if(c==2)
cout<<a<<"*"<<b<<"="<<endl;
else if(c==3)
cout<<a<<"/"<<b<<"="<<endl;
}
return 0;

}

原文:http://www.cnblogs.com/qinxian0/p/5248113.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!