Advertisement
dsavov_02

Дърво

Nov 4th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using System;
  2.                    
  3. public class Program
  4. {
  5.     public static void Main()
  6.     {
  7.         int n = int.Parse(Console.ReadLine());
  8.         Console.Write(new string (' ',n));
  9.         Console.WriteLine("|");
  10.         for ( int i = 0; i <= n; i++)
  11.         {
  12.             Console.Write(new string(' ',n-i));
  13.             Console.Write(new string ('*', i));
  14.             Console.Write("|");
  15.             Console.Write(new string ('*', i));
  16.             Console.WriteLine(new string(' ',n-i));
  17.         }
  18.             Console.Write(new string(' ',n));
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement