C#01

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(); }
}
}
上一篇:【AI视野·今日CV 计算机视觉论文速览 第203期】Fri, 21 May 2021


下一篇:star和rsem的下载安装