3
#include <iostream>
using namespace std;
class Rectgangle{
private:
int length;
int width;
public:
void js(int l,int w){
length=l;
width=w;
}
void sj(){
cout<<"周长是:"<<(length+width)*2<<endl;
cout<<"面积是:"<<length*width;
}
};
int main(){
Rectgangle a;
a.js(10,20);
a.sj();
return 0;
}

浙公网安备 33010602011771号