问一道类相关的题,为什么我第三排的输出一直都是同一句呢,之前的内容有点忘了.应该是setrange()这一块的问题

问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图
#include<iostream>
using namespace std;

class rectangle
{
    private:
        float length=0.0;
        float width=0.0;
    public:
        void setlength()
        {
            //cout<<"输入length:";
            cin>>length;
        }
        void setwidth()
        {
            //cout<<"输入width:";
            cin>>width;
        }
        /*****************************************************/
        float getlength()
        {
            cout<<"length: "<<length;
        }
        float getwidth()
        {
            cout<<"width: "<<width;
        }
        /******************************************************/
        void setrange()
        {
            
            if(0.0<length<20.0&&0.0<width<20.0)
            {
                cout<<"length and width are both in 0.0 - 20.0"<<endl;
            }
            else if(0.0<length<20.0!=1)
            {
                cout<<"length is not in 0.0 - 20.0"<<endl;
            }
            else if(0.0<width<20.0!=1)
            {
                cout<<"width is not in 0.0 - 20.0"<<endl;
            }    
        }
        /************************计算周长******************************/
        void Perimeter()
        {
            int Per=(length+width)*2;
            cout<<"Perimeter: "<<Per<<endl;
        }
        /*************************计算面积**********************************/
        void Area()
        {
            int A=length*width;
            cout<<"Area: "<<A<<endl;
        }
        /*******************************************************************************************************************/
};

int main()
{
    rectangle R;
    R.setlength();R.setwidth();
    R.getlength();cout<<"    ";R.getwidth(); 
    cout<<endl;
    R.setrange();
    R.Perimeter();
    R.Area();
    system("pause");
    return 0;
}


![img](https://img-mid.csdnimg.cn/release/static/image/mid/ask/801939891846166.png "#left")


运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果

img

c++里面不能用连续比较,0.0<length<20.0应该写成 length>0.0 && length < 20.0
0.0<length<20.0实际运算时是先比较0.0和length,比较结果true和false转成1和0后,再与20.0比较