标签:
double h,g,x,m; Console.Write("性别(男,女):"); string s = Console.ReadLine(); Console.Write("请输入您的身高"); h = Convert.Todouble(Console.ReadLine()); Console.Write("请输入您的体重"); g = Convert.Todouble(Console.ReadLine()); x = (s=="男"? 100:110);//条件运算符 m = g - h + x; Console.WriteLine(m > 3 ? "减肥" : (m <= -3 ? "优秀": "太瘦"));
Console .ReadLine ();
标签:
原文地址:http://www.cnblogs.com/Mr-xue/p/4378962.html