c#程序问题:在文本框内用星号打印1个倒三角windows应用程序
1个回答
展开全部
string star = "*";
string pace=" ";
for (int i = 12; i > 0; i--)
{
string rolStar = "";
string rolPace = "";
for (int j = 1; j <= i; j++)
{
rolStar += star+pace;
}
for (int p = 1; p <= (12- i); p++)
{
rolPace += pace;
}
this.textBox1.Text += rolPace + rolStar + "\r\n";
}
string pace=" ";
for (int i = 12; i > 0; i--)
{
string rolStar = "";
string rolPace = "";
for (int j = 1; j <= i; j++)
{
rolStar += star+pace;
}
for (int p = 1; p <= (12- i); p++)
{
rolPace += pace;
}
this.textBox1.Text += rolPace + rolStar + "\r\n";
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询