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

运行成功输出错误

 string [,]nScore=new string[,]
            {
                {"景珍","90"},{"林惠洋","65"},
                {"成蓉","88"},{"洪南昌","70"},
                {"龙玉民","46"},{"单江开","81"},
                {"田武山","100"},{"王三明","68"}
            };
            int sum = 0;
            int avg = 0;
            string name = nScore[0, 0];
            int i = 0;
            string[] tName = new string[] { };
            
            for (i = 0; i < Convert.ToInt32(nScore.GetLength(0)); i++)
            {
                sum = sum + Convert.ToInt32(nScore[i, 1]);
                
               
            }
            avg = sum / Convert.ToInt32(nScore.GetLength(0));
            Console.WriteLine("平均分是{0},高于平均分的有:", avg);
            for (i = 0; i < Convert.ToInt32(nScore.GetLength(0)); i++)
            {
                
                if (Convert.ToInt32(nScore[i, 1]) > avg)
                {
                    name = nScore[i, 0];
                    Console.Write(name+" ");
                   
                }

            }

正在回答

1 回答

"平均分是{0},高于平均分的有:", avg);

双引号中的逗号和冒号改成中文的就能通过了Console.WriteLine("平均分是{0},高于平均分的有:", avg);

1 回复 有任何疑惑可以回复我~
#1

IT通行证 提问者

正解 赞赞赞
2019-05-04 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

运行成功输出错误

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信