為什么提示運(yùn)行成功,輸出錯(cuò)誤呢?
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? ?string[] name = { "吳松", "錢東宇", "伏晨", "陳陸", "周蕊", "林日鵬", "何昆", "關(guān)欣" };
? ? ? ? ? ? int[] score = new int[] { 89, 90, 98, 56, 60, 91, 93, 85 };
? ? ? ? ? ? int max = 0;
? ? ? ? ? ? int m = 0;
? ? ? ? ? ? for (int i = 0; i < score.Length; i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if (score[i] > max)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? max = score[i];
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? else
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? continue;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? m = i;
? ? ? ? ? ? }
? ? ? ? ? ? Console.WriteLine("分?jǐn)?shù)最高的是{0},分?jǐn)?shù)是{1}", name[m], score[m]);
? ? ? ? }
? ? }
}
2018-08-07
我用你的代碼測(cè)試了許久,發(fā)現(xiàn)是? Console.WriteLine("分?jǐn)?shù)最高的是{0},分?jǐn)?shù)是{1}", name[m], score[m]);其中{0}后面的逗號(hào)是英文逗號(hào),應(yīng)該改成中文逗號(hào)。
2018-08-07
姓名和分?jǐn)?shù)不對(duì),還有就是輸出的逗號(hào)和冒號(hào)是中文格式