1 solutions

  • 0
    @ 2025-3-3 16:29:41

    C++ :

    #include <bits/stdc++.h>
    using namespace std;
    
    int main(){
    	int h,w;//身高、体重
    	cin>>h>>w;
    	double r = w / (h * h * 1.0 / 100 / 100);
    	if(r >= 24){
    		cout<<"Too fat!"<<endl;
    		cout<<w - (int)(24 * (h * h * 1.0 / 100 / 100))<<endl;
    	}else if(r <= 18){
    		cout<<"Too thin!"<<endl;
    		cout<<(int)ceil((18 * (h * h * 1.0 / 100 / 100)) - w)<<endl;
    	}else{
    		cout<<"Good!"<<endl;
    	}
    }
    
    
    • 1

    Information

    ID
    10290
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By