Advertisement
archangelmihail

BatGojkoTower

Nov 27th, 2013
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.20 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. namespace Bat_GojkoTower
  8. {
  9.     class BatGojkoTower
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int height = 0;
  14.             int count = 1;
  15.             int move = 2;
  16.             do
  17.             {
  18.                 height = int.Parse(Console.ReadLine());
  19.             } while (height <2 || height > 39);
  20.              
  21.             for (int row = 0; row < height; row++)
  22.             {
  23.                  
  24.                 Console.Write(new string('.', height - row - 1));
  25.                 Console.Write('/');
  26.                 if (count == row)
  27.                 {
  28.                     Console.Write(new string('-', row * 2));
  29.                     count += move++;
  30.                      
  31.                 }
  32.                 else
  33.                 {
  34.                     Console.Write(new string('.', row * 2));
  35.                 }
  36.  
  37.                  
  38.                 Console.Write('\\');
  39.                 Console.Write(new string('.', height - row - 1));
  40.                 Console.WriteLine();
  41.                  
  42.                  
  43.             }
  44.              
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement