Guest User

Untitled

a guest
May 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.11 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4.  
  5.     class House
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.  
  10.             string[] numbers = Console.ReadLine().Split(new string[] { " " }, StringSplitOptions.None);
  11.  
  12.             int N = int.Parse(numbers[0]);
  13.             int K = int.Parse(numbers[1]);
  14.  
  15.             int whiteCount = N-1;
  16.  
  17.             //the pokriv of the kushta
  18.             for (int i = 1; i <= N; i++, whiteCount--)
  19.             {
  20.                 for (int j = 0; j < whiteCount; j++)
  21.                     Console.Write(" ");
  22.  
  23.                 for (int j = 1; j <= i; j++)
  24.                     Console.Write("/");
  25.  
  26.                 for (int j = 1; j <= i; j++)
  27.                     Console.Write("\\");
  28.  
  29.                 Console.WriteLine();
  30.             }
  31.  
  32.  
  33.             //purviq etaj
  34.             for (int i = 1; i <= K; i++)
  35.             {
  36.                 for (int j = 1; j <= (N - K); j++)
  37.                     Console.Write(" ");
  38.  
  39.                 for (int j = 1; j <= K*2; j++)
  40.                     Console.Write("=");
  41.  
  42.                 Console.WriteLine();
  43.  
  44.             }
  45.  
  46.         }
  47.     }
Add Comment
Please, Sign In to add comment