Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.03 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.     static void Main()
  6.     {      
  7.         int input = int.Parse(Console.ReadLine());
  8.         int size = input - 2;
  9.         string frame = new string('*', input * 2) + new string(' ', input) + new string('*', input * 2);
  10.         string glass = new string('*', 1) + new string('/', (input * 2)-2 ) + new string('*', 1) + new string(' ', input) + new string('*', 1) + new string('/', (input * 2)-2 ) + new string('*', 1);
  11.         string middle = new string('*', 1) + new string('/', (input * 2) - 2) + new string('*', 1) + new string('|', input) + new string('*', 1) + new string('/', (input * 2) - 2) + new string('*', 1);
  12.  
  13.         Console.WriteLine(frame);
  14.         for(int i = 0; i < size; i++)
  15.         {
  16.             if ( (double)i == ((int)Math.Ceiling((double)size / (double)2))-1)
  17.             {
  18.                 Console.WriteLine(middle);
  19.  
  20.             }
  21.             else
  22.             {
  23.                 Console.WriteLine(glass);
  24.             }
  25.  
  26.         }
  27.         Console.WriteLine(frame);
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement