为了账号安全,请及时绑定邮箱和手机立即绑定

正在回答

1 回答

namespace csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int i,avg,sum=0;
            string[,] a = new string[8, 2] { {"景珍","90"}, {"林慧洋","65" }, { "成蓉","88"}, { "洪南昌","70"}, {"龙玉民","46" }, {"单开江","81" }, {"田武山","100" }, { "王三明","68"} };
            for (i=0;i<a.GetLongLength(0);i++)
            {
                sum += int.Parse(a[i,1]);
            }
            avg = sum / 8;
            Console.Write ("平均分是{0},",avg);
            Console.WriteLine(" 高于平均分的有:");
            for (i = 0; i < a.GetLongLength(0); i++)
            {
                if (int.Parse(a[i, 1]) > avg)
                    Console.Write(a[i,0]+" ");
            }
        }
    }
}

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
C#开发轻松入门
  • 参与学习       254042    人
  • 解答问题       1459    个

本门课程是C#语言的入门教程,将带你轻松入门.NET开发

进入课程
意见反馈 帮助中心 APP下载
官方微信