#include<iostream.h>
class calculator
{
private:
int i,num1,num2,result[4];
public:
calculator(int a,int b)
{
num1=a;
num2=b;
}
void add()
{
result[0]=num1+num2;
}
void minus()
{
if(num1>num2)
result[1]=num1-num2;
else
result[1]=num2-num1;
}
void multiply()
{
result[2]=num1*num2;
}
void divide()
{
result[3]=num1/num2;
}
void display()
{
for(i=0;i<4;i++)
cout<<"结果为:"<<result[i]<<endl; //依次输出加减乘除后的结果
}
};
void main()
{
int x,y;
cin>>x>>y;
calculator c1(x,y);
c1.add(); //两个数相加
c1.minus(); //两个数相减
c1.multiply(); //两个数相乘
c1.divide(); //两个数相除
c1.display();
}