来一杯枸杞泡茶
2018-07-11 09:47
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]+" ");
}
}
}
}
Program.cs(21,11): error CS1525: Unexpected symbol `for'
为什么会出现这种错误?
C#开发轻松入门
254118 学习 · 1459 问题
相似问题