效果
代码
Console.WriteLine("姓名"); //输入
string xm = Console.ReadLine();
Console.WriteLine("语文");
string yw = Console.ReadLine();
Console.WriteLine("数学");
string sx = Console.ReadLine();
Console.WriteLine("英语");
string yy = Console.ReadLine();
double ym1 = Convert.ToDouble(yw); //转换
double sx1 = Convert.ToDouble(sx);
double yy1 = Convert.ToDouble(yy);
double zcj = ym1 + sx1 + yy1; //相加
double zcj1=Convert.ToDouble(zcj);
double pjz=zcj1 /3;
Console.WriteLine("{0},你的总成绩为{1}分,平均成绩为{2}分",xm ,zcj1, pjz);//输出
Console.ReadKey();