c# asp.net 写的代码 int line=5; // 行数 也就是你说的n
//控制输出多少行
for(int i=0;i
//输出空格
for (int x = 0; x < line-i; x++)
{
Response.Write(" ");
}
//输出星号
for(int y=0;y<2*i+1;y++)
{
Response.Write("*");
}
Response.Write( "
\n");
}
你是要程序?还是结果?