public static void Drawing(int rowCount)
{
if(rowCount < 3 || rowCount > 21)
{
Console.WriteLine('输入的行数必须位于3与21之间');
return;
}
string printChar = "**************************************";
string emptyChar = " ";
StringBuilder printResult = new StringBuilder();
for(int i=rowCount,j=0;i>0; i--,j++)
{
printResult = printResult.Append(printChar.Substring(0,i)).Append(emptyChar.Substring(0,j)).Append("\r\n");
}
Console.WriteLine(printResult.ToString());
}
// 手写代码。没测试