#編碼
? ? ? ? ? ? Console.Write("輸入行數(shù):");
? ? ? ? ? ? string str_a = Console.ReadLine();
? ? ? ? ? ? int a = Convert.ToInt32(str_a);
? ? ? ? ? ? for (int i = 1; i <= a; i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? for (int j = 0; j < a - i ; j++)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? Console.Write(" ");
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? for (int j = 0; j < 2 * i - 1; j++)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? Console.Write("*");
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? Console.WriteLine();
? ? ? ? ? ? }
? ? ? ? ? ? Console.ReadKey();
#效果
