PavelManahilov

Sunglasses

Sep 2nd, 2015
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1. using System;
  2.  
  3.   public  class Sunglasses
  4.     {
  5.         public static void Main()
  6.         {
  7.             int N = int.Parse(Console.ReadLine());
  8.             for (int i = 0; i < N; i++)
  9.             {
  10.                 if (i == 0 || i == N - 1)
  11.                 {
  12.                     Console.WriteLine("{0}{1}{0}", new string('*',N*2), new string(' ', N));
  13.                 }
  14.                 else if (i == N/2)
  15.                 {
  16.                     Console.WriteLine("{0}{1}{0}{2}{0}{1}{0}", new string('*',1), new string('/',N*2-2), new string('|',N));
  17.                 }
  18.                 else
  19.                 {
  20.                     Console.WriteLine("{0}{1}{0}{2}{0}{1}{0}", new string('*', 1), new string('/', N * 2 - 2), new string(' ', N));
  21.                 }
  22.             }
  23.         }
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment