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

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

運行顯示 無法將類型string 隱式轉(zhuǎn)換為int

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

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

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

? ? ? ? ? {

? ? ? ? ? ? ? int max=0;

? ? ? ? ? ? ? int b=0;

? ? ? ? ? ? ? if (scores[i]>max)

? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? max= scores[i];

? ? ? ? ? ? ? ? ? b=i;

? ? ? ? ? ? ? ? ? Console.WriteLine("分數(shù)最高的是{0},分數(shù)是{1}",names[i],scores[i]);

? ? ? ??

? ? ? ? ? ? ? }

? ? ? ? ? }


正在回答

3 回答

? ? ? ? ? ? string[,] result = new string[8, 2] { { "吳松", "89" }, { "錢東宇", "90" }, { "伏晨", "98" }, { "陳陸", "56" }, { "周蕊", "60" }, { "林日鵬", "91" }, { "何昆", "93" }, { "關欣", "85" } };

? ? ? ? ? ? int x = int.Parse(result[0,1]),y;

? ? ? ? ? ? for (int i = 0; i<result.GetLongLength(0);i++)

? ? ? ? ? ? {? ??

? ? ? ? ? ? ? ? y=int.Parse(result[i,1]);

? ? ? ? ? ? ? ? if (y > x)

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? x = y;

? ? ? ? ? ? ? ? }

? ? ? ? ? ? }

? ? ? ? ? ? for (int j = 0; j < result.GetLongLength(0); j++)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? y = int.Parse(result[j, 1]);

? ? ? ? ? ? ? ? if (x == y)

? ? ? ? ? ? ? ? {?

? ? ? ? ? ? ? ? ? ? string name=result[j,0];

? ? ? ? ? ? ? ? ? ? Console.WriteLine("分數(shù)最高的是"+name+",分數(shù)是:"+x);

? ? ? ? ? ? ? ? ? ? break;

? ? ? ? ? ? ? ? }

? ? ? ? ? ? }


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

可以轉(zhuǎn)化再進行比較大小

例如string s=“123”;

int x=int.Parse(s);

1 回復 有任何疑惑可以回復我~
#1

ayu971017 提問者

好的,謝謝
2018-07-27 回復 有任何疑惑可以回復我~

聲明scores 里面 int類型加了“ ”

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

舉報

0/150
提交
取消

運行顯示 無法將類型string 隱式轉(zhuǎn)換為int

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

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

幫助反饋 APP下載

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

公眾號

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