第1个回答 推荐于2018-04-15
c# asp.net 写的代码 int line=5; // 行数 也就是你说的n
//控制输出多少行
for(int i=0;i<line;i++)
{
//输出空格
for (int x = 0; x < line-i; x++)
{
Response.Write(" ");
}
//输出星号
for(int y=0;y<2*i+1;y++)
{
Response.Write("*");
}
Response.Write( "<br>\n");
}本回答被网友采纳