6 solutions

  • 0
    @ 2025-4-17 17:40:11
    using namespace std;
    int main()
    {
    	double a,b;
    	cin>>a>>b;
    	a=a/(b*b);
    	if(a<18.5)
    	{
    		cout<<"Underweight";
    	}
    	else if(a>=18.5&&a<24)
    	{
    		cout<<"Normal";
    	}
    	else
    	{
    		cout<<a;
    		cout<<endl;
    		cout<<"Overweight";
    	}
    	
    	return 0;
    }
    
    

    判断就好了,但要用double

    Information

    ID
    392
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    6
    Tags
    # Submissions
    354
    Accepted
    113
    Uploaded By