#include<iostream>
using namespace std;
class cal
{
public:
virtual int getresult()
{
return 0;
}
int num1;
int num2;
};
class add:public cal
{
public:
int getresult()
{
return num1+num2;
}
};
class sub:public cal
{
public:
int getresult()
{
return num1-num2;
}
};
class mul:public cal
{
public:
int getresult()
{
return num1*num2;
}
};
class chu:public cal
{
public:
int getresult()
{
return num1/num2;
}
};
void test()
{
cal *c1=new add;
c1->num1=100;
c1->num2=20;
cout<<c1->num1<<"+"<<c1->num2<<"="<<c1->getresult()<<endl;
delete c1;
c1=new sub;
c1->num1=100;
c1->num2=24;
cout<<c1->num1<<"-"<<c1->num2<<"="<<c1->getresult()<<endl;
delete c1;
cal *c2=new mul;
c2->num1=12;
c2->num2=12;
cout<<c2->num1<<"*"<<c2->num2<<"="<<c2->getresult()<<endl;
cal *c3=new chu;
c3->num1=100;
c3->num2=10;
cout<<c3->num1<<"/"<<c3->num2<<"="<<c3->getresult()<<endl;
add a1;
a1.num1=100;
a1.num2=100;
cout<<a1.num1<<"+"<<a1.num2<<"="<<a1.getresult()<<endl;
}
int main()
{
test();
}