用c#编写 演讲比赛,10个评委给选手打分求平均即为该歌手的得分。程序输入10个评委的分数,打印该歌

2025-03-11 03:22:52
推荐回答(3个)
回答1:

double count=0;
for(int i=0;i<10;i++)
{
输出:请输入第“i+1”位评委分数
count+=Convert.ToDouble(接收分数);
}

平均分是count/10

回答2:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Test_ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
double score = 0;
for (int i = 0; i < 10; i++)
{
string str=string.Format("请输入第{0}位裁判评分:",i+1);
Console.WriteLine(str);
score += Convert.ToDouble(Console.ReadLine());
}
Console.WriteLine("歌手的成绩为:{0}", score / 10);
Console.ReadLine();
}
}
}

回答3:

(评委一的分数+二+三....)/10