给你修改了一下,我自己也写了一个。你对照一下就好了。using System;
class San
{
public static void Main()
{
int i;
i=Console.Read()-48;
for (int m=0;m<i;m++)
{
int j;
for (j=0;j<i-m
;j++)
Console.Write(" ");
for (int l=0;l<2 * m + 1
;l++)
Console.Write("*"
);
Console.WriteLine(); } Console.Read();
Console.Read();
}
}using System;
class San
{
public static void Main()
{
int i = Console.Read()-48;
for(int m = 1; m <= i ; m++)
{
string strBlank = new string(' ',i - m);
string strStar = new string('*',2 * m - 1);
Console.WriteLine(strBlank + strStar);
}
Console.ReadLine();
Console.ReadLine(); }
}