Venciity

[SoftUni C# exam preparation] 04.BatGoikoTower

Apr 9th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.22 KB | None | 0 0
  1. using System;
  2.  
  3.     class BatGoikoTower
  4.     {
  5.         static void Main()
  6.         {
  7.             int n = int.Parse(Console.ReadLine());
  8.             int counter = -2;
  9.             for (int row = 0; row < n; row++)
  10.             {
  11.                 for (int i = 0; i <= counter; i++)
  12.                 {
  13.  
  14.                     Console.Write(new string('.', n - row - 1));
  15.                     Console.Write("/");
  16.                     Console.Write(new string('.', row));
  17.  
  18.                     Console.Write(new string('.', row));
  19.                     Console.Write("\\");
  20.                     Console.Write(new string('.', n - row - 1));
  21.                     Console.WriteLine();
  22.  
  23.                     row++;
  24.                     if (row == n)
  25.                     {
  26.                         return;
  27.                     }
  28.                 }
  29.  
  30.                 Console.Write(new string('.', n - row - 1));
  31.                 Console.Write("/");
  32.                 Console.Write(new string('-', row));
  33.  
  34.                 Console.Write(new string('-', row));
  35.                 Console.Write("\\");
  36.                 Console.Write(new string('.', n - row - 1));
  37.                 Console.WriteLine();
  38.  
  39.                 counter++;
  40.             }
  41.         }
  42.     }
Advertisement
Add Comment
Please, Sign In to add comment