我哪里有問(wèn)題啊 我在vs上面都沒(méi)問(wèn)題 在這里就不行
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? string[] name = new string[] { "吳松", "錢(qián)東宇", "伏晨", "陳陸", "周蕊", "林日鵬", "何昆", "關(guān)欣" };
? ? ? ? ? ? int[] a = new int[] {89,90,98,56,60,91,93,85 };
? ? ? ? ? ? int max;
? ? ? ? ? ? max = a[0];
? ? ? ? ? ? int sy = 0;
? ? ? ? ? ? for(int i=1;i<a.Length;i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if (a[i] > max)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? max = a[i];
? ? ? ? ? ? ? ? ? ? sy = i;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? Console.Write("分?jǐn)?shù)最高的是" +name[sy]+","+"分?jǐn)?shù)是"+max);
? ? ? ? ? ??
? ? ? ? }
? ? }
}
2020-07-24
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? int max;
? ? ? ? ? ? string[] name = new string[]{"吳松","錢(qián)東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關(guān)欣"};
? ? ? ? ? ? int[] num = new int[]{89,90,98,56,60,91,93,85};
? ? ? ? ? ? max=num[0];
? ? ? ? ? ? string k =name[0];
? ? ? ? ? ? for(int i=1;i<num.Length;i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if(num[i]>max)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? max=num[i];
? ? ? ? ? ? ? ? ? ? k=name[i];
? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? Console.Write("分?jǐn)?shù)最高的是{0},分?jǐn)?shù)是{1},",k,max);
? ? ? ? }
? ? }
}
2020-07-06
?,看來(lái)不是我一個(gè)人是這個(gè)思路,?
2020-03-13
你的代碼沒(méi)錯(cuò),不對(duì)是因?yàn)槊趾头謹(jǐn)?shù)之間的,是中文的,你的是英文?
2020-03-13
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? string[,] chengji=new string[,]{
? ? ? ? ? ? ? ? {"吳松","89"},{"錢(qián)東宇","90"},
? ? ? ? ? ? ? ? {"伏晨","98"},{"陳陸","56"},
? ? ? ? ? ? ? ? {"周蕊","60"},{"林日鵬","91"},
? ? ? ? ? ? ? ? {"何昆","93"},{"關(guān)欣","85"}
? ? ? ? ? ? };
? ? ? ? ? ? string[] zuigao=new string[2];
? ? ? ? ? ? for(int x=0; x<chengji.GetLongLength(0);x++){
? ? ? ? ? ? ? ? if(zuigao[0]!=null && Convert.ToInt32(zuigao[1])>Convert.ToInt32(chengji[x,1])) continue;
? ? ? ? ? ? ? ? else{
? ? ? ? ? ? ? ? ? ? zuigao[0]=chengji[x,0];
? ? ? ? ? ? ? ? ? ? zuigao[1]=chengji[x,1];
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? Console.WriteLine("分?jǐn)?shù)最高的是{0},分?jǐn)?shù)是{1}",zuigao[0],zuigao[1]);
? ? ? ? }
? ? }
}
2020-03-05
代碼確實(shí)沒(méi)問(wèn)題,我寫(xiě)的也對(duì)就是在這上面不對(duì),你的i從0開(kāi)始比較規(guī)范,改一改