菱形

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
           for (int i = 1; i <= 10; i++)
            {
                for (int a = 1; a <= 10 - i;a++)
                {
                    Console.Write("  ");
                }
                for (int b = 1; b <=2*i-1;b++)
                {
                    Console.Write("");
                }
                Console.WriteLine("
");
            }
            for (int k = 1; k < 10; k++)
            {
                for (int d = 1; d <= k; d++)
                {
                    Console.Write("  ");
                }
                for (int c = 1; c <= 2 * (10 - k) - 1; c++)
                {
                    Console.Write("");
                }
               
                Console.WriteLine("
");
            }
        }
    }
}
原文地址:https://www.cnblogs.com/qixinjian/p/4586102.html