一oO
2015-11-03 11:45
string[] name = new string[2];
int[] score = new int[2];
for (int i = 0; i < name.Length; i++)
{
Console.Write("请输入第" + (i + 1) + "名的姓名:");
name[i] = Console.ReadLine();
Console.Write("请输入第" + (i + 1) + "名的分数:");
score[i] = int.Parse(Console.ReadLine());
}
int sum = 0, avg;
int j = 0;
for (int i = 0; i < score.Length; i++)
{
{
sum += score[i];
}
avg = sum /( score.Length);
{
if (score[i] > avg)
j = i;
}
score[i] = avg;
Console.Write("平均值:{0}高于平均值的同学:{1}", avg, name[i]);
傻逼啊
C#开发轻松入门
254118 学习 · 1459 问题
相似问题