能輸出題目要求的結(jié)果,但是為什么說我錯(cuò)了?
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {?string[] a = { "吳松", "錢東宇", "伏晨", "陳陸", "周蕊", "林日鵬", "何昆", "關(guān)欣" };
? ? ? ? ? ? int[] b = { 89, 90, 98, 56, 60, 91, 93, 85 };
? ? ? ? ? ? int x = 0;
? ? ? ? ? ? int y = 0;
? ? ? ? ?for (int i = 0; i < b.Length; i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if (b[i] > x)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? x = b[i];
? ? ? ? ? ? ? ? ? ? y = i;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? Console.WriteLine("分?jǐn)?shù)最高的是" + a[y] + "," + "分?jǐn)?shù)是" + x);
? ? ? ? }
? ? }
}
2019-07-10
逗號(hào)不對(duì)額。。 用這個(gè) ,