#include<iostream>
using namespace std;
class c1
{
public:
int length, breadth;
c1()
{
cin>>length>>breadth;
}
};
class c2:public c1
{
public:
void area(int length,int breadth)
{
cout<<2*(length+breadth);
}
};
int main() {
c2 one;
one.area(one.length,one.breadth);
return 0;
}
using namespace std;
class c1
{
public:
int length, breadth;
c1()
{
cin>>length>>breadth;
}
};
class c2:public c1
{
public:
void area(int length,int breadth)
{
cout<<2*(length+breadth);
}
};
int main() {
c2 one;
one.area(one.length,one.breadth);
return 0;
}
No comments:
Post a Comment