10.25(2)

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication2

{

class Program

{

static void Main(string[] args)

{

/**

* 让用户输入姓名 语文 数学 英语 三门课的成绩,

* 然后给用户显示:XX,你的总成绩为XX分

* ,平均成绩为XX分

* */

Console.WriteLine("请你输入名字");

string name = Console.ReadLine();

Console.WriteLine("请你输入的语文成绩");

string str_chinese=Console.ReadLine();

Console.WriteLine("请你输入的数学成绩");

string str_math = Console.ReadLine();

Console.WriteLine("请你输入的英语成绩");

string str_English= Console.ReadLine();

int chinese = Convert.ToInt32(str_chinese);

int math = Convert.ToInt32(str_math);

int english = Convert.ToInt32(str_English);

Console.WriteLine("你的总分为:{0},平均分为:{1}", chinese + math + english, (chinese + math + english) / 3);

Console.ReadKey();

}

}

}

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容