Advertisement
Guest User

Untitled

a guest
Oct 12th, 2016
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.13 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 Sunglasses
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.  
  15.             for (int row = 0; row < n; row++)
  16.             {
  17.                 for (int col = 0; col < 5 * n; col++)
  18.                 {
  19.                     if (col >= 2 * n && col < 3 * n)
  20.                     {
  21.                         if (row == (n - 1) / 2)
  22.                         {
  23.                             Console.Write("|");
  24.                         }
  25.                         else
  26.                         {
  27.                             Console.Write(" ");
  28.                         }
  29.  
  30.                     }
  31.                     else if ((row == 0 || row == n - 1) || (col == 0 || col == 2 * n - 1 || col == 3 * n || col == 5 * n - 1))
  32.                     {
  33.                         Console.Write("*");
  34.                     }
  35.                     else Console.Write("/");
  36.                 }
  37.                 Console.WriteLine();
  38.             }
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement