调试没有问题,但是w的结果却总是-89053460,为什么啊

#include
using namespace std;
class shape
{protected:
int x,y;
public:
shape()
{
x=0;
y=0;
}
shape(int q,int w)
{
x=q;
y=w;
}
};
class circle: public shape
{
int r;
public:
circle()
{
r=1;
}
circle(int q1,int q,int w):shape(q,w)
{
r=q1;
}
void point()
{
cout<<"x="<<x<<endl;
cout<<"y="<<y<<endl;
cout<<"r="<<r<<endl;
}

};
class rect: public shape
{
int w,h;
public:
rect(int u,int t,int q,int w):shape(q,w)
{
w=u;h=t;
}
rect()
{
w=1;h=1;
}
void input()
{
cout<<"x="<<x<<endl;
cout<<"y="<<y<<endl;
cout<<"w="<<w<<endl;
cout<<"h="<<h<<endl;
}

};
int main()
{
shape s;
circle c1;
circle c2(2,2,2);
rect r1;
rect r2(6,7,8,9);
c1.point ();
c2.point ();
r1.input ();
r2.input ();
return 0;
}

图片说明
没错啊

打印出-89053460说明w根本没有初始化,根本没有被赋值
因为你的w=u;编译器把它当做了传进来的形参w,not类里面的w
改成this->w=u;