2023-08-22|閱讀時間 ‧ 約 2 分鐘

test

test program

private static void Main(string[] args)
{
int max = 5;
bool debug = false; //改成true,就會顯示詳細資訊;false,會顯示*結果

for(int i=1; i<max; i++)
{
for(int j=1; j<max; j++)
{
if (debug) Console.Write("i = " + i + ", j = " + j);

if (i<j)
{
if (debug)
{
Console.Write(" 符合條件 ");
}
else
{
Console.Write("*");
}
}

if (debug) Console.WriteLine();
}
Console.WriteLine();
}
}
分享至
成為作者繼續創作的動力吧!
從 Google News 追蹤更多 vocus 的最新精選內容從 Google News 追蹤更多 vocus 的最新精選內容

發表回應

成為會員 後即可發表留言