Advertisement
dimipan80

Exam 4. New House

Jun 13th, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. namespace _3.NewHouse
  2. {
  3.     using System;
  4.  
  5.     public class DrawingNewHouse
  6.     {
  7.         public static void Main(string[] args)
  8.         {
  9.             checked
  10.             {
  11.                 int width = int.Parse(Console.ReadLine());
  12.  
  13.                 string asterisksSeq = string.Empty;
  14.                 for (int i = 1; i <= width; i += 2)
  15.                 {
  16.                     asterisksSeq = new string('*', i);
  17.                     string dashSeq = new string('-', (width - i) / 2);
  18.                     Console.WriteLine("{0}{1}{0}", dashSeq, asterisksSeq);
  19.                 }
  20.  
  21.                 for (int j = 0; j < width; j++)
  22.                 {
  23.                     asterisksSeq = new string('*', width - 2);
  24.                     Console.WriteLine("{0}{1}{0}", '|', asterisksSeq);
  25.                 }
  26.             }
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement