定义一个矩形类rectangle,有长宽等属性,计算面积周长,重载其构造函数rectangle()、rectangle( int length, int width) ,下面的代码不知道哪里不对

#include<iostream.h>
class Rectangle{
public:
Rectangle(){
length=1;
width=2;
}
Rectangle(double l,double w){
length=l;
width=w;
}
double getC(){
C=2*(length+width);
return C;
}
double getS(){
S=length*width;
return S;
}
void print(){
cout<<"length="<<length<<endl;
cout<<"width="<<width<<endl;
cout<<"C="<<C<<endl;
cout<<"S="<<S<<endl;
}
private:
double length,width,C,S;
};

void main(){
Rectangle r1,r2(3,4);
r1.getC();
r1.getS();
r2.getC();
r2.getS();
}