111,126
社区成员
发帖
与我相关
我的任务
分享for (i = 0; i < 1; i++)
{
System.Console.WriteLine(@"**********
* *
* *
* *
* *
* *
**********");
} internal class Program
{
private static void Main(string[] args)
{
int cols = 10;
int lines = 7;
string stars = new string('*', cols - 2);
string blanks = new string(' ', cols - 2);
string format = "*{0}*";
for(int i = 0; i < lines; i++)
{
bool isClosure = i == 0 || i == lines - 1;
Console.WriteLine(string.Format(format, isClosure ? stars : blanks));
}
Console.ReadLine();
}
}