明明都已經(jīng)一樣的代碼了,為何還是不通過,看不出問題在哪
string[] name={"吳松","錢東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關(guān)欣"};
? ? ? ? ? ? int[]score={89,90,98,56,60,91,93,85};
? ? ? ? ? ? int max=score[0];
? ? ? ? ? ? string topName=null;
? ? ? ? ? ? for(int i=0;i<score.Length;i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? if(score[i]>max)??
? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? max=score[i];
? ? ? ? ? ? ? ? ? topName=name[i];
? ? ? ? ? ? ? }
? ? ? ? ? ? ?
? ? ? ? ? ? }
? ? ? ? ? ? ?Console.WriteLine("分數(shù)最高的是{0},分數(shù)是{1}",topName,max);
2018-10-11
"分數(shù)最高的是{0},分數(shù)是{1}" 這句話里面的逗號改成中文的逗號
2018-11-13
Console.WriteLine("分數(shù)最高是{0},分數(shù)是{1}",Topnum,Maximum);
只能說是里面有兩個中文逗號,記住{0}后面一個逗號,{1}后面還有一個逗號
2018-11-13
我的也顯示打印正確可就是不過關(guān) 中文逗號也試了
? string[] a = new string[]{ "吳松", "錢東宇", "伏晨", "陳陸", "周蕊", "林日鵬", "何昆", "關(guān)欣"? };
??????????? int[] b = new int[] { 90, 90, 98, 56, 60, 91, 93, 95 };
??????????? int max=0;
??????????? int c=0;
??????????? for (int x = 0; x < a.Length; x++)
??????????? {
??????????????? if (b[x] > max)
??????????????? {
??????????????????? max = b[x];
??????????????????? c = x;
??????????????? }?????????????
??????????? }
??????????????? Console.Write("分數(shù)最高的{0},分數(shù)是{1}",a[c],b[c]);
2018-10-19
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ?int[] score = new int[] { 89, 90, 98, 86, 60, 91, 93, 85 };
? ? ? ? ? ? string[] name = new string[] { "吳松", "錢東宇", "伏晨", "陳陸", "周蕊", "林日鵬", "何昆", "關(guān)欣" };
? ? ? ? ? ? int max = 0;
? ? ? ? ? ? string topName = null;
? ? ? ? ? ? for (int i = 0; i < score.Length; i++)
? ? ? ? ? ? ? ? if (score[i] > max)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? max = score[i];
? ? ? ? ? ? ? ? ? ? topName = name[i];
? ? ? ? ? ? ? ? }
? ? ? ? ? ? Console.Write("分數(shù)最高的是{0},分數(shù)是{1}", topName, max);
? ? ? ? }
? ? }
}