1 条题解

  • 7
    @ 2024-12-20 14:11:34
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int a;
    	double b;
    	cin>>a>>b;
    	double c;
    	int u;
    	c=a*1.0/b/b;
    	if(c<18.5){
    		cout<<"Underweight";
    		return 0;
    	}
    	if(c>=18.5&&c<24){
    		cout<<"Normal";
    		return 0;
    	}
    	else{
    		u=100000*c;
    		if(u%10>=5){
    			u=u/10+1;
    		}
    		else u/=10;
    		int o=0;
    		while(u%10==0){
    			u/=10;
    			o++;
    		}
    		int y=4;
    		y=y-o;
    		int ss=1;
    		for(int i=1;i<=y;i++){
    			ss*=10;
    		}
    		cout<<(double)u/ss<<endl;
    		cout<<"Overweight";
    	}
    	return 0;
    }
    
    • 1

    信息

    ID
    522
    时间
    1000ms
    内存
    256MiB
    难度
    4
    标签
    (无)
    递交数
    25
    已通过
    16
    上传者