#include <iostream>
using namespace std;
class clsMesinKira{
private:
int a,b;
public:
void setData(float p, float q){
a=p;
b=q;
}
void doCampur(void){
cout<<a+b<<endl;
}
void doTolak(void){
cout<<a-b<<endl; //andaikan nilai pertama tolak nilai kedua
}
void doDarab(void){
cout<<a*b<<endl; //andaikan nilai pertama darab nilai kedua
}
void doBahagi(void){
cout<<a/b<<endl; //andaikan nilai pertama bahagi nilai kedua
}
};
int main() {
clsMesinKira objMesinKira;
objMesinKira.setData(1,2);
objMesinKira.doCampur();
objMesinKira.doTolak();
objMesinKira.doDarab();
objMesinKira.doBahagi();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNsYXNzIGNsc01lc2luS2lyYXsKCXByaXZhdGU6CgkJaW50IGEsYjsKCXB1YmxpYzoKCQl2b2lkIHNldERhdGEoZmxvYXQgcCwgZmxvYXQgcSl7CgkJCWE9cDsKCQkJYj1xOwoJCX0KCgkJdm9pZCBkb0NhbXB1cih2b2lkKXsKCQkJY291dDw8YStiPDxlbmRsOwoJCX0KCgkJdm9pZCBkb1RvbGFrKHZvaWQpewoJCQljb3V0PDxhLWI8PGVuZGw7IC8vYW5kYWlrYW4gbmlsYWkgcGVydGFtYSB0b2xhayBuaWxhaSBrZWR1YQoJCX0KCQl2b2lkIGRvRGFyYWIodm9pZCl7CgkJCWNvdXQ8PGEqYjw8ZW5kbDsgLy9hbmRhaWthbiBuaWxhaSBwZXJ0YW1hIGRhcmFiIG5pbGFpIGtlZHVhCgkJfQoJCXZvaWQgZG9CYWhhZ2kodm9pZCl7CgkJCWNvdXQ8PGEvYjw8ZW5kbDsgLy9hbmRhaWthbiBuaWxhaSBwZXJ0YW1hIGJhaGFnaSBuaWxhaSBrZWR1YQoJCX0KCgoKfTsKCgoKaW50IG1haW4oKSB7CgljbHNNZXNpbktpcmEgb2JqTWVzaW5LaXJhOwoJb2JqTWVzaW5LaXJhLnNldERhdGEoMSwyKTsJCglvYmpNZXNpbktpcmEuZG9DYW1wdXIoKTsKCW9iak1lc2luS2lyYS5kb1RvbGFrKCk7CglvYmpNZXNpbktpcmEuZG9EYXJhYigpOwoJb2JqTWVzaW5LaXJhLmRvQmFoYWdpKCk7CglyZXR1cm4gMDsKfQ==