Advertisement
Guest User

elha

a guest
Feb 18th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.91 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 ConsoleApp27
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             {
  14.                 var spaces = 0;
  15.  
  16.                 int n = int.Parse(Console.ReadLine());
  17.                 for (int row = 1; row <= n; row++)
  18.                 {
  19.                     spaces = n;
  20.                     Console.Write(new string(' ', n - row));
  21.                     Console.WriteLine(string.Join(string.Empty, Enumerable.Repeat("* ", row)));
  22.                     Console.WriteLine();
  23.                     Console.Write(new string(' ', n - row));
  24.                     Console.WriteLine(string.Join(string.Empty, Enumerable.Repeat("* ", row)));
  25.                 }
  26.                 Console.WriteLine(new string ('|', spaces + spaces -1));
  27.             }
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement