Advertisement
Svetli0o

BatGoiko'sTower

Apr 2nd, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.12 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. class Program
  8. {
  9.     static void Main(string[] args)
  10.     {
  11.         int height = int.Parse(Console.ReadLine());
  12.         int width = 2 * height;
  13.         int counter = width / 2 - 1;
  14.         int counter2 = width / 2;
  15.         int[] numbers = { 1, 3, 6, 10, 15, 21, 28, 36 };
  16.         for (int i = 0; i < height; i++)
  17.         {
  18.             for (int j = 0; j < width; j++)
  19.             {
  20.                 if (j == counter)
  21.                 {
  22.                     Console.Write('/');
  23.                 }
  24.                 else if (j == counter2)
  25.                 {
  26.                     Console.Write('\\');
  27.                 }
  28.                 else if ((Array.IndexOf(numbers, i) != -1) && counter < j && j < counter2)
  29.                 {
  30.                     Console.Write('-');
  31.                 }
  32.                 else
  33.                 {
  34.                     Console.Write('.');
  35.                 }
  36.             }
  37.             counter2++;
  38.             counter--;
  39.             Console.WriteLine();
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement