什么是得分率? double[] score = new double[5] { 65,65.5,54,45,75.5}; Console.WriteLine("平均得分:{0}",score.Average());
double[] result ={ 65, 65.5, 54, 45, 75.5 }; double sum = 0; for (int i = 0; i < result.Length; i++) { sum += result[i]; } double avg = sum / result.Length;
SS表 StudentName Score A 65 B 65.5 C 54 D 45 E 75.5 一条SQL语句: select count(*) as 学生个数,avg(Score) as 平均分,(sum(Score)/(学生个数*100))*100 as 得分百分数 from SS;
Console.WriteLine("平均得分:{0}",score.Average());
double sum = 0;
for (int i = 0; i < result.Length; i++)
{
sum += result[i];
}
double avg = sum / result.Length;
StudentName Score
A 65
B 65.5
C 54
D 45
E 75.5
一条SQL语句:
select count(*) as 学生个数,avg(Score) as 平均分,(sum(Score)/(学生个数*100))*100 as 得分百分数 from SS;