請問我哪錯(cuò)了,麻煩請教一下
using System;
using System.Collections.Generic;
using System.Text;
namespace projAboveAvg
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? int sum=0;
? ? ? ? ? ? int smu=0;
? ? ? ? ? ? string name[] =new string{"景珍","林惠洋","成蓉","洪南昌","龍玉民","單江開","田武山","王三明"};
? ? ? ? ? ? int sore[]=new int={90,65,88,70,46,81,100,68};
? ? ? ? ? ? for(int i=0;i<sore.Length;i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? sum+=sore[i];
? ? ? ? ? ? }
? ? ? ? ? ? sum=sum/sore.Length;
? ? ? ? ? ? Console.WriteLine("平均分是{0},高于平均分的有:" ,sum);
? ? ? ? ? ? for(int i=0;i<sore.Length;i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if(sore[i]>sum)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? Console.Write(name[i] + " ");??
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? }
? ? }
}
2020-08-17
?int sore[]=new int={90,65,88,70,46,81,100,68};? 這一行后面的"="號不需要
?int smu=0;? 這個(gè)定義了沒用上可以刪除
2020-07-21
"平均分是{0},高于平均分的有:"
逗號和冒號是中文模式下的