资源描述
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
int n = 11;
int d = n * 2 - 1;
for (int i = 1; i <= n; i++)
{
for(int j=1;j<=n+i-1;j++)
{
if ((j != n - i + 1) && (j != n + i - 1))
{
Console.Write(" ");
}
else
{
Console.Write("*");
}
}
Console.Write("\n");
}
for (int i = n; i >= 1; i--)
{
for (int j = d; j >= 1; j--)
{
if ((j != n + i - 1) && (j != n - i + 1))
{
Console.Write(" ");
}
else
{
Console.Write("*");
}
}
Console.Write("\n");
}
Console.ReadKey();
}
}
}
展开阅读全文