test

2023/08/22閱讀時間約 1 分鐘

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();
}
}
郵定密
郵定密
留言0
查看全部
發表第一個留言支持創作者!
從 Google News 追蹤更多 vocus 的最新精選內容