static void Main(string[] args)
{
//用户输入
Console.Write("请输入姓名:");
string name = Console.ReadLine();
Console.Write("请输入语文成绩:");
decimal chinese = Convert.ToDecimal(Console.ReadLine());
Console.Write("请输入数学成绩:");
decimal mathematics = Convert.ToDecimal(Console.ReadLine());
Console.Write("请输入英语成绩:");
decimal english = Convert.ToDecimal(Console.ReadLine());
Console.WriteLine("----------------------信息展示-----------------------");
Console.WriteLine(name + ",你的总成绩为:" + (chinese + mathematics + english) + "分,平均成绩为:" + (chinese + mathematics + english) / 3 + "分。");
Console.ReadKey();
}
温馨提示:内容为网友见解,仅供参考