using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace 判断体重偏轻中
{
class Program
{
static void Main(string[] args)
{
Console.Write("请输入你的性别:");
string s = Console.ReadLine();
Console.Write("请输入你的身高(cm):");
double a = int.Parse(Console.ReadLine());
Console.Write("请输入你的体重(kg):");
double b = int.Parse(Console.ReadLine());
if (s == "男")
{
double c = b - a + 100;
if (c <= 3 && c >= -3)
{
Console.WriteLine("你的体重标准");
}
else if (c < -3)
{
Console.WriteLine("你体重偏瘦");
}
else
{
Console.WriteLine("你的体重偏胖");
}
}
else if (s == "女") //此处需要加else,否则将运行显示:输入有误
{
double d = b - a + 110;
if (d <= 3 && d >= -3)
{
Console.WriteLine("你的体重标准");
}
if (d < -3)
{
Console.WriteLine("你体重偏瘦");
}
else
{
Console.WriteLine("你的体重偏胖");
}
}
else
{
Console.WriteLine("输入有误");
}
Console.ReadLine();
}
}
}