Advertisement
fbinnzhivko

03.01 Plaid Towel

Mar 16th, 2016
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.48 KB | None | 0 0
  1. using System;
  2. namespace PlaidTowel
  3. {
  4.     class Program
  5.     {
  6.         static void Main()
  7.         {
  8.             int size = int.Parse(Console.ReadLine());
  9.             char background = char.Parse(Console.ReadLine());
  10.             char symbol = char.Parse(Console.ReadLine());
  11.  
  12.             Console.WriteLine(new string(background, size) + symbol + new string(background, (size * 2) - 1) + symbol + new string(background, size));
  13.  
  14.             for (int j = 0; j < 2; j++)
  15.             {
  16.                 int backCount = size;
  17.                 int separator = 1;
  18.                 int middle = (size * 2) - 1;
  19.                 for (int i = 0; i < size - 1; i++)
  20.                 {
  21.                     middle -= 2;
  22.                     backCount--;
  23.  
  24.                     Console.Write(new string(background, backCount));
  25.                     Console.Write(symbol);
  26.                     Console.Write(new string(background, separator));
  27.                     Console.Write(symbol);
  28.                     Console.Write(new string(background, middle));
  29.                     Console.Write(symbol);
  30.                     Console.Write(new string(background, separator));
  31.                     Console.Write(symbol);
  32.                     Console.Write(new string(background, backCount));
  33.                     Console.WriteLine();
  34.                     separator += 2;
  35.                 }
  36.                 Console.WriteLine(symbol + new string(background, (size * 2) - 1) + symbol + new string(background, (size * 2) - 1) + symbol);
  37.                 backCount = 0;
  38.                 middle = 1;
  39.                 for (int i = 0; i < size - 1; i++)
  40.                 {
  41.  
  42.                     backCount++;
  43.                     separator -= 2;
  44.                     Console.Write(new string(background, backCount));
  45.                     Console.Write(symbol);
  46.                     Console.Write(new string(background, separator));
  47.                     Console.Write(symbol);
  48.                     Console.Write(new string(background, middle));
  49.                     Console.Write(symbol);
  50.                     Console.Write(new string(background, separator));
  51.                     Console.Write(symbol);
  52.                     Console.Write(new string(background, backCount));
  53.                     Console.WriteLine();
  54.                     middle += 2;
  55.                 }
  56.                 Console.WriteLine(new string(background, size) + symbol + new string(background, (size * 2) - 1) + symbol + new string(background, size));
  57.             }
  58.         }
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement