注意:下面的評論中 數組string[,] score = new string[,]{ }中元素沒有寫,還有打印語句Console.WriteLine("分數最高的是{0},分數是{1}",name,max);沒寫,因為評論寫不下了。
2015-10-12
string[,] score = new string[,]{ }
int max = Convert.ToInt32(score[0, 1]);
string name = null ;
for (int i = 0; i < score.GetLongLength(1); i++)
{ if (Convert.ToInt32(score[i, 1]) > max)
{max = Convert.ToInt32(score[i, 1]);
name = score[i, 0]; }}
int max = Convert.ToInt32(score[0, 1]);
string name = null ;
for (int i = 0; i < score.GetLongLength(1); i++)
{ if (Convert.ToInt32(score[i, 1]) > max)
{max = Convert.ToInt32(score[i, 1]);
name = score[i, 0]; }}
2015-10-12
static void Main(string[] args)
{
Console.Write("請輸入一個整數");
int y=int.Parse(Console.ReadLine());//百度一下,這個好像是輸入一個整數的標準格式?
if(y<5)
Console.Write("輸入有誤!");
else
{while(y>5)
{
y-- ;
}
while (y>=1)
{
Console.Write(y+" ");y--;
}
}
}
{
Console.Write("請輸入一個整數");
int y=int.Parse(Console.ReadLine());//百度一下,這個好像是輸入一個整數的標準格式?
if(y<5)
Console.Write("輸入有誤!");
else
{while(y>5)
{
y-- ;
}
while (y>=1)
{
Console.Write(y+" ");y--;
}
}
}
2015-10-12