string[,] nameScoreArr = new string[4,2]{{"吳松","89"},{"錢東","90"},{"周蕊","98"},{"關(guān)欣","78"}};
int maxIndex = 0;
for (int x=1;x<nameScoreArr.GetLongLength(0);x++) {
if (int.Parse(nameScoreArr[x,1]) > int.Parse(nameScoreArr[maxIndex,1])) {
maxIndex = x;
}
}
int maxIndex = 0;
for (int x=1;x<nameScoreArr.GetLongLength(0);x++) {
if (int.Parse(nameScoreArr[x,1]) > int.Parse(nameScoreArr[maxIndex,1])) {
maxIndex = x;
}
}
2022-08-29
最新回答 / 慕工程9249744
using System;using System.Collections.Generic;using System.Text;namespace Test{? ? class Program? ? {? ? ? ? static void Main(string[] args)? ? ? ? {? ? ? ? ? ? double salary = 6000.00;//基本工資? ? ? ? ? ? double prize = 3200.00;//獎(jiǎng)金? ? ? ? ? ? double tax = ...
2022-08-27
switch的方法有點(diǎn)簡單,應(yīng)該再詳細(xì)說明一下,比如case的的語句塊{}以及不加語句塊的區(qū)別,加了語句塊 可以申明局部相同的變量等。。
2022-08-24
最新回答 / 慕虎5491227
?for (int y=1;x<=7;y++)這里第二個(gè)循環(huán)條件錯(cuò)了,把x改為y即可,設(shè)置為x就會讓第二層循環(huán)沒辦法跳出循環(huán)造成死循環(huán)。
2022-08-04
{ string today;//今天的午飯
string tomorrow;//明天的午飯
string temp;
today = "魚香肉絲";
tomorrow = "小雞燉蘑菇";
temp=tomorrow;
tomorrow=today;
today=temp;
//請?jiān)谶@里補(bǔ)充代碼,實(shí)現(xiàn)變量today和tomorrow的交換
這樣子交換是不是不臺符合邏輯啊,雖然也成功了
string tomorrow;//明天的午飯
string temp;
today = "魚香肉絲";
tomorrow = "小雞燉蘑菇";
temp=tomorrow;
tomorrow=today;
today=temp;
//請?jiān)谶@里補(bǔ)充代碼,實(shí)現(xiàn)變量today和tomorrow的交換
這樣子交換是不是不臺符合邏輯啊,雖然也成功了
2022-07-29
最新回答 / 崔勇
①標(biāo)識符只能由英文字母、數(shù)字和下劃線組成,不能包含空格和其他字符。②變量名不能用數(shù)字開頭。③不能用關(guān)鍵字當(dāng)變量名??吹谝粭l,"#"號,不能出現(xiàn)在變量名中哦搜索復(fù)制
2022-07-15
最新回答 / 慕數(shù)據(jù)3346302
?if(num[i]>max)? ? ? ? ? ? max=num[i];? ? ? ? ? ? name=xingming[i];if下面兩條語句要用{}括起來,確保兩條語句都是受if條件限制,否則只有if下面第一句是受if條件限制的,第二句話會一直執(zhí)行到for循環(huán)最后一次
2022-07-13
要注意定義變量之后,要給變量進(jìn)行賦值,否則會報(bào)錯(cuò):“該變量為局部變量”,還有注意if 語句的包含區(qū)域,要把該包含的內(nèi)容用中括號括起來,注意這些!!
2022-06-29
最新回答 / qq_慕哥7147956
int i, max=0, x=0;? ? ? ? ? ? string[] names = new string[8] { "吳松", "錢東宇", "伏晨", "陳陸", "周蕊", "林日鵬", "何昆", "關(guān)欣" };? ? ? ? ? ? int[] values = new int[8] { 89, 90, 98, 56, 60, 91, 93, 85 };? ? ? ? ? ? for (i = 0; i < values.Length; i++)? ? ? ? ? ? {? ? ?...
2022-06-29