C#语言 求4名同学三门成绩的平均值
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; namespace ConsoleApplication1
{
class Program
{
static float sum1 = , sum2 = , sum3 = ;
static void Main(string[] args)
{
//for循环输入成绩
for (int i = ; i < ;i++ )
{
Console.Write("Input English:");
float m = float.Parse(Console.ReadLine());
Console.Write("Input C#:");
float c = float.Parse(Console.ReadLine());
Console.Write("Input chinese:");
float h = float.Parse(Console.ReadLine()); sum1 = sum1 + m;
sum2 = sum2 + c;
sum3 = sum3 + h;
} Console.Write("English:{0}", sum1 / );
Console.Write("C#:{1},", sum2 / );
Console.Write("chinese",sum3 / );
Console.Read(); }
}
}