Console.WriteLine("请输入你的姓名");
string strname=Console.ReadLine();
Console.WriteLine("请输入你的语文成绩");
string sitChinese = Console.ReadLine();
Console.WriteLine("请输入你的数学成绩");
string sitmath = Console.ReadLine();
Console.WriteLine("请输入你的英语成绩");
string sitenglish = Console.ReadLine();
string name = Convert.ToString(strname);
int chinese = Convert.ToInt32(sitChinese);
int math = Convert.ToInt32(sitmath);
int english = Convert.ToInt32(sitenglish);
int SUM=chinese+math+english;
int average = SUM / 3;
Console.WriteLine("{0},您的总成绩为{1}分,平均成绩为{2}分", name, SUM, average);
Console.ReadLine();
网友评论