我確信我缺少某些愚蠢的東西。我想將消息 打印到控制檯窗口,並在同一行顯示最大數組值。將最大數組值寫入控制檯窗口
當我運行的代碼沒有控制檯消息它運行完美,但是當我運行 與消息的代碼,它只顯示消息,沒有最大值。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Arrays
{
class Program
{
static void Main(string[] args)
{
int[] newArray = new int[6];
newArray[0] = 0;
newArray[1] = 1;
newArray[2] = 2;
newArray[3] = 49;
newArray[4] = 3;
newArray[5] = 82;
Console.Write("The highest number in the array is: ", newArray.Max());
Console.ReadLine();
}
}
}
我剛剛開始獲得數組的掛起,但我找不到上述問題的解決方案。
Console.Write(以下簡稱「數組中最大的數字是:{0}「,newArray.Max()); – JOSEFtw