軟件能夠運行,在這里報錯
using System;
using System.Collections.Generic;
using System.Text;
namespace projAboveAvg
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args
? ? ? ? ? ? ?string[] name = new string[] { "景珍", "林惠洋", "成蓉", "洪南昌", "龍玉民", "單江開", "田武山", "王三明" };
? ? ? ? ? ? int[] score = new[] { 90, 65, 88, 70, 46, 81, 100, 68 };
? ? ? ? ? ? int sum = 0, ?ave=0;
? ? ? ? ? ? {
? ? ? ? ? ? ? ? foreach (int x in score)
? ? ? ? ? ? ? ? ? ? sum += x;
? ? ? ? ? ? ? ? ? ? ave = sum / score.Length;
? ? ? ? ? ? }
? ? ? ? ? ? Console.WriteLine("平均分是{0},高于平均分的有:", ave);
? ? ? ? ? ? for (int i = 0; i < score.Length; i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if (score[i] > ave)
? ? ? ? ? ? ? ? ? ? Console.Write(name[i]+ ' ');
? ? ? ? ? ? }
? ? ? ? ?
? ? ? ? ? ??
? ? }
}
2017-09-22
你看看你的main方法都被破壞了。static void Main(string[] args){}
2017-09-22
感謝仔細閱讀,但是這個是復制過來的時候變得,那部分是給出來的,應該不是這個的原因