#include <iostream>
using namespace std;
class InputData{
private:
int data_a;
int data_b;
public:
int get_a(){
data_a=45;
return data_a;
}
int get_b(){
data_b=45;
return data_b;
}
};
class Arith_Unit: public InputData{
public:
int add(){
return (get_a()+get_b());
}
int sub(){
return (get_a()-get_b());
}
int mul(){
return (get_a()*get_b());
}
int div(){
return (get_a()/get_b());
}
};
class Logic_Unit: public InputData{
public:
int and_(){
return (get_a()&&get_b());
}
int or_(){
return (get_a()||get_b());
}
int xor_(){
return (!get_a()||get_b());
}
};
class ALUnit: public Arith_Unit, public Logic_Unit{
};
int main()
{
InputData e;
e.get_a();
e.get_b();
return 0;
Comments
Leave a comment