3
我無法顯示輸出窗口,有誰能告訴我我在這裏失蹤了什麼?我試圖以金字塔形式顯示#
符號。如何使用C#在windows應用程序格式中顯示輸出窗口?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace variable
{
class Program
{
static void Main()
{
for (int row = 0; row < 6; row++)
{
// Counting backwards here!
for (int spaces = 6 - row; spaces > 0; spaces--)
{
Console.Write(" ");
}
for (int column = 0; column < (2 * row + 1); column++)
{
Console.Write("#");
}
Console.WriteLine();
}
Console.Read();
}
}
}
什麼問題?怎麼了?您是否在項目屬性中將輸出類型設置爲控制檯? – SLaks
你根本不用'Form'。現在輸出將寫入控制檯('stdout')。 –