grach

RombusOfStar

Jul 19th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Rhombus_of_Stars
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             int n = int.Parse(Console.ReadLine());
  15.  
  16.             for (int i = 1; i <= n; i++)
  17.             {
  18.                 Console.Write(new string(' ', n - i));
  19.  
  20.  
  21.                 for (int j = 0; j < i; j++)
  22.                 {
  23.                     Console.Write("* ");
  24.                 }
  25.                 Console.WriteLine();
  26.             }
  27.  
  28.             for (int i = n - 1; i > 0; i--)
  29.             {
  30.                 Console.Write(new string(' ', n - i));
  31.  
  32.                 for (int j = 0; j < i; j++)
  33.                 {
  34.                     Console.Write("* ");
  35.                 }
  36.                 Console.WriteLine();
  37.             }
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment