Advertisement
YankoZlatanov

TriangleForFun

Nov 15th, 2014
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.46 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3.  
  4.  
  5. class TringleJustForFun
  6. {
  7.     static void Main()
  8.     {
  9.         Console.OutputEncoding = Encoding.UTF8;
  10.         int input = int.Parse(Console.ReadLine());  
  11.         int temp = input;
  12.         int count = 0;
  13.         Console.WindowWidth = (input*2)+1;          
  14.         Console.WindowHeight = input + 4;
  15.         string c = "©";
  16.         string boxUp = new string('-', (temp * 2) + 1);
  17.         Console.WriteLine(boxUp);
  18.         string firstSpaces = new string('/', input - 1);            
  19.         Console.WriteLine("|" + firstSpaces + c + firstSpaces + "|");
  20.         /**********************************************/
  21.         for (count = 0; count < (input - 2); count++)              
  22.         {
  23.             string nextSpaces = new string('/', (input - (count + 2)));  
  24.  
  25.             string midSpaces = new string('\\', (count * 2) + 1);        
  26.             Console.WriteLine("|" + nextSpaces + c + midSpaces + c + nextSpaces + "|");
  27.         }
  28.  
  29.         /**********************************************/
  30.  
  31.         Console.Write("|");
  32.         for (count = 0; count < (temp * 2) - 1; count++)
  33.         {
  34.             if (count % 2 == 0)
  35.             {
  36.                 Console.Write("©");
  37.             }
  38.             else
  39.             {
  40.                 Console.Write(" ");
  41.             }
  42.         }
  43.         Console.Write("|\n");
  44.         string boxDown = new string('-', (temp * 2) + 1);
  45.         Console.WriteLine(boxDown);
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement