码迷,mamicode.com
首页 > 其他好文 > 详细

四则运算

时间:2015-03-06 23:32:03      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:

代码

#include<iostream>
using namespace std;

void main(){
int x,y,z;
for(int i=0;i<30;i++){
x = rand()%100;
y = rand()%100;
z = rand()%4;
if(z ==1 )
cout<<x<<" + "<<y<<endl;
if(z ==2 )
cout<<x<<" - "<<y<<endl;
if(z ==3 )
cout<<x<<" * "<<y<<endl;
if(z ==4 )
cout<<x<<" / "<<y<<endl;
}
}

 

四则运算

标签:

原文地址:http://www.cnblogs.com/laozhanghahaha/p/4319439.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!