题解 | 简单运算
简单运算
https://www.nowcoder.com/practice/23c9b22d40fa4d7698a1306fb0c9f975
#include <iostream>
using namespace std;
int main() {
// write your code here......
int a,b,c;
int he,cha,ji,shang,mo;
while(cin >> a >> b)
{
if(a<1 ||b<1 ||a>9999 ||b>9999)
{
return 0;
}
if(a<b)
{
c=a;
a=b;
b=c;
}
he=a+b;
cha=a-b;
ji=a*b;
shang=a/b;
mo=a%b;
cout <<he<<' '<<cha<<' '<<ji<<' '<<shang<<' '<<mo<<' '<<endl;
}
return 0;
}
