第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

請問這那錯了

using System;

using System.Collections.Generic;

using System.Text;


namespace projGetMaxScore

{

? ? class Program

? ? {

? ? ? ? static void Main(string[] args)

? ? ? ? {

? ? ? ? ? ? string[] name = { "吳松", "錢東宇", "伏晨", "陳陸", "周蕊", "林日鵬", "何昆", "關(guān)欣" };

? ? ? ? ? ? int[] score = { 89, 90, 98, 56, 60, 91, 93, 85 };??

? ? ? ? ? ? int max=score[0];

? ? ? ? ? ? for(int i=0;i<score.Length;i++)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? if(score[i]<score[i+1])

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? max=score[i+1];

? ? ? ? ? ? ? ? }

? ? ? ? ? ? }Console.WriteLine("分?jǐn)?shù)最高的是{0},分?jǐn)?shù)是{1}",name[max],score[max]);?

? ? ? ? }

? ? }

}


正在回答

3 回答

? ? ? ? ? ? string[,]? sor=new string[,]

? ? ? ? ? ? {{"吳松","89"},{"錢東宇","90"},{"伏晨","98"},{"陳陸","56"},{"周蕊","60"},{"林日鵬","91"},{"何昆","93"},{"關(guān)欣","85"}? ? ? ? ? ? };

? ? ? ? ? ? //Console.WriteLine(sor.GetLength(0));

? ? ? ? ? ? int Max = 0;

? ? ? ? ? ? string Name="";

? ? ? ? ? ? for (int i = 0; i < sor.GetLength(0)-1; i++)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? if (int.Parse(sor[i, 1]) > Max)

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? Max = int.Parse(sor[i, 1]);

? ? ? ? ? ? ? ? ? ? Name = sor[i, 0];

? ? ? ? ? ? ? ? }

? ? ? ? ? ? }

? ? ? ? ? ? Console.WriteLine("分?jǐn)?shù)最高的是" + Name + ",分?jǐn)?shù)是" + Max);


0 回復(fù) 有任何疑惑可以回復(fù)我~

你的max的值獲取的應(yīng)該是i的值,而不是score[i]


0 回復(fù) 有任何疑惑可以回復(fù)我~

數(shù)組越界

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消
C#開發(fā)輕松入門
  • 參與學(xué)習(xí)       255663    人
  • 解答問題       1523    個

本門課程是C#語言的入門教程,將帶你輕松入門.NET開發(fā)

進入課程

請問這那錯了

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號