您的位置:首页 > 其它

if语句判断身高体重是否标准

2015-07-07 16:58 281 查看
1.判断身高,体重是否标准

Console.WriteLine("请输入您的身高:");
int sg = Convert.ToInt32(Console.ReadLine());

Console.WriteLine("请输入您的体重:");
int tz = Convert.ToInt32(Console.ReadLine());

Console.WriteLine("请输入您的性别:");
string xb = Console.ReadLine();

if (xb =="男")
{
int bzs = sg - 100 + 3;
int bzx = sg - 100 - 3;

if (tz >= bzx && tz <= bzs)
{
Console.WriteLine("您的身材不错");
}
else if (tz < bzx)
{
Console.WriteLine("您太瘦了,多吃点");
}
else
{
Console.WriteLine("不能再吃了");
}

}

else if (xb=="女")
{
int bzs = sg - 110 + 3;
int bzx = sg - 110 - 3;

if (tz >= bzx && tz <= bzs)
{
Console.WriteLine("身材好,身材火辣");
}
else if (tz < bzx)
{
Console.WriteLine("美女,有点瘦了");
}
else
{
Console.WriteLine("再吃女神变屌丝了");
}
}
else
{
Console.WriteLine("没有您这种性别的人,请自己核实");
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: