#include <iostream>
using namespace std;
class Rect
{
private:
int width,height;
public:
void init(int w,int h);
int set_w ();
int set_h ();
void show();
};
void Rect::init(int width, int height)
{
this->width = width;
this->height = height;
}
int Rect::set_w()
{
cin >> width;
return width;
}
int Rect::set_h()
{
cin >> height;
return width;
}
void Rect::show()
{
cout << "S=" << width*height << endl;
}
int main()
{
cout << "我真的很帅" << endl;
Rect rect;
// rect.init(4,5);
rect.set_w();
rect.set_h();
rect.show();
return 0;
}
学习嵌入式的第39天
最新推荐文章于 2024-09-01 23:06:50 发布