亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

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

不知道哪里錯了

namespace ConsoleApp11

{

? ? class Program

? ? {

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

? ? ? ? {

? ? ? ? ? ? string[] names = new string[8] { "吳松", "錢東宇", "伏晨", "陳陸", "周蕊", "林日鵬", "何昆", "關欣" };

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

? ? ? ? ?

? ? ? ? ? ? int x = 0;

? ? ? ? ? ? for (x=0;x<8;x++ )

? ? ? ? ? ? {? ??

? ? ? ? ? ? ? ? if (scores[x] > scores[0])

? ? ? ? ? ? ? ? {? ?

? ? ? ? ? ? ? ? ? ? scores[0] =scores[x];

? ? ? ? ? ? ? ? ?}

? ? ? ? ? ? ?}

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

? ? ? ? ? ?Console.Write("分數最高的是" + names[x] + "分數是" + max );


? ? ? ? }

? ? }

}


正在回答

2 回答

字符串name為空

0 回復 有任何疑惑可以回復我~

改成這樣

? string[] names = new string[8] { "吳松", "錢東宇", "伏晨", "陳陸", "周蕊", "林日鵬", "何昆", "關欣" };

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

? ? ? ? ? ? string name = null;

? ? ? ? ? ? int x = 0;

? ? ? ? ? ? for (x=0;x<8;x++ )

? ? ? ? ? ? {? ??

? ? ? ? ? ? ? ? if (scores[x] > scores[0])

? ? ? ? ? ? ? ? {? ?

? ? ? ? ? ? ? ? ? ? scores[0] =scores[x];

? ? ? ? ? ? ? ? ? ? name=names[x];

? ? ? ? ? ? ? ? ? ?

? ? ? ? ? ? ? ? ?}

? ? ? ? ? ? ? ? ?

? ? ? ? ? ? ? ? ?

? ? ? ? ? ? ?}

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

? ? ? ? ? ?

? ? ? ? ? ?Console.Write("分數最高的是{0},分數是{1}",name,max );

第三行是什么意思

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
C#開發輕松入門
  • 參與學習       256136    人
  • 解答問題       1527    個

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

進入課程

不知道哪里錯了

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號