svetlozar_kirkov

Isosceles Triangle

Sep 26th, 2014
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleTest
  4. {
  5.     class ConsoleTest
  6.     {
  7.         static void Main()
  8.         {
  9.             Console.OutputEncoding = System.Text.Encoding.Unicode;
  10.             byte size = 15;
  11.  
  12.             for (int i = 0, j = 1, k = size; i < size; i++, j += 2, k--)
  13.             {
  14.                 if (i > 0 && i < size - 1)
  15.                 {
  16.                     Console.Write(new string(' ', k));
  17.                     Console.Write(new string('\u00A9', 1));
  18.                     Console.Write(new string(' ', j-2));
  19.                     Console.Write(new string('\u00A9', 1));
  20.                     Console.Write(new string(' ', k));
  21.                     Console.WriteLine();
  22.                 }
  23.                 else
  24.                 {
  25.                     Console.Write(new string(' ', k));
  26.                     Console.Write(new string('\u00A9', j));
  27.                     Console.Write(new string(' ', k));
  28.                     Console.WriteLine();
  29.                 }
  30.             }
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment