,當我在這個節目輸出的最佳它炸燬整數數量應該是多少有些道理的。很難理解這個實數是什麼!價值觀發生翹曲
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Safr_Manager
{
class Program
{
static void Main(string[] args)
{
var sortarry = new[] {'4', '6', '4', '7', '8', '3'};
int best = -1;
for(int i = 0; i < 6; i++)
{
var cursel = sortarry[i];
if (cursel > best)
{
best = cursel;
}
Console.WriteLine(cursel);
Console.WriteLine(best);
}
}
}
}
這就是它輸出的內容。你可以看到它如何改變當前最好的部分應該是什麼!
Current selected: 4
Current best: 52
Current selected: 6
Current best: 54
Current selected: 4
Current best: 54
Current selected: 7
Current best: 55
Current selected: 8
Current best: 56
Current selected: 3
Current best: 56
52表示炭的值 '4',從陣列 –
除去單引號或'Console.WriteLine(Char.GetNumericValue(最好)的ToString());' – Slai