提交不通過
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? string [] names = {"吳松","錢東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關欣"};
? ? ? ? ? ? int [] scores = {89,90,98,56,60,91,93,85};
? ? ? ? ? ? int max = scores[0];
? ? ? ? ? ? int k=0;
? ? ? ? ? ? for(int i=0;i<scores.Length;i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if(max <= scores[i])
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? max = scores[i];
? ? ? ? ? ? ? ? ? ? k=i;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? Console.WriteLine("分數最高的是{0},分數是{1}",names[k],max);
? ? ? ? }
? ? }
}
2016-10-22
其實很簡單,你這個程序應該是沒有問題的,只可能是幕課的答案驗證的問題,你可以把分數最高的是{0},分數是{1}這一句里面的逗號變成中文的逗號,(親測有效)