Advertisement
Guest User

Plaid Towel

a guest
Oct 19th, 2015
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.37 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 Problem3
  8. {
  9.     class Problem3
  10.     {
  11.         static void Main()
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.             char background = char.Parse(Console.ReadLine());
  15.             char rhombus = char.Parse(Console.ReadLine());
  16.             int center = n * 2 - 1;
  17.             int dots = 1;
  18.  
  19.             Console.WriteLine("{0}{1}{2}{1}{0}", new string(background, n), new string(rhombus, 1), new string(background, center));
  20.  
  21.             for (int i = n-1; i > 0; i--)
  22.             {
  23.                 center -= 2;
  24.                 Console.WriteLine("{0}{1}{2}{1}{3}{1}{2}{1}{0}",new string(background, i), new string(rhombus, 1), new string(background, dots),
  25.                     new string(background, center));
  26.                 dots += 2;
  27.             }
  28.  
  29.             Console.WriteLine("{0}{1}{0}{1}{0}",new string(rhombus,1), new string(background, dots));
  30.  
  31.             for (int i = 1; i < n ; i++)
  32.             {
  33.                 dots -= 2;
  34.                 Console.WriteLine("{0}{1}{2}{1}{3}{1}{2}{1}{0}", new string(background, i), new string(rhombus, 1), new string(background, dots),
  35.                     new string(background, center));
  36.                 center += 2;
  37.             }
  38.  
  39.             Console.WriteLine("{0}{1}{2}{1}{0}", new string(background, n), new string(rhombus, 1), new string(background, center));
  40.  
  41.             for (int i = n - 1; i > 0; i--)
  42.             {
  43.                 center -= 2;
  44.                 Console.WriteLine("{0}{1}{2}{1}{3}{1}{2}{1}{0}", new string(background, i), new string(rhombus, 1), new string(background, dots),
  45.                     new string(background, center));
  46.                 dots += 2;
  47.             }
  48.  
  49.             Console.WriteLine("{0}{1}{0}{1}{0}", new string(rhombus, 1), new string(background, dots));
  50.  
  51.             for (int i = 1; i < n; i++)
  52.             {
  53.                 dots -= 2;
  54.                 Console.WriteLine("{0}{1}{2}{1}{3}{1}{2}{1}{0}", new string(background, i), new string(rhombus, 1), new string(background, dots),
  55.                     new string(background, center));
  56.                 center += 2;
  57.             }
  58.  
  59.             Console.WriteLine("{0}{1}{2}{1}{0}", new string(background, n), new string(rhombus, 1), new string(background, center));
  60.  
  61.  
  62.         }
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement