有大佬能幫我看一下嗎?
using System;
using System.Collections.Generic;
using System.Text;
namespace projAboveAvg
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ?string [8,2]name=new string[]{ {"景珍","90"},{"林惠洋","65"},{"成容","88"},{"洪南昌","70"},{"龍玉民","46"},{"單江開","81"},{"田武山","100"},{"王三明","68"} };
? ? ? ? ? ?int sum=0;
? ? ? ? ? ?int avg;
? ? ? ? ? ?for(int i=0;i<8;i++)
? ? ? ? ? ?{
? ? ? ? ? ? ? ?sum+=int.parse(nama[i,1]);
? ? ? ? ? ?}
? ? ? ? ? ?avg=sum/8;
? ? ? ? ? ?Console.Write("平均分是"+avg);
? ? ? ? ? ?Console.WriteLine("高于平均分的有:")
? ? ? ? ? ?for(int a=0;a<8;a++)
? ? ? ? ? ?{
? ? ? ? ? ? ? ?if(name[a,1]>avg)
? ? ? ? ? ? ? ?Console.Write(name[a,0]+" ");
? ? ? ? ? ?}
? ? ? ? }
? ? }
}
2018-07-11
為什么會出現(xiàn)這種錯誤?