Advertisement
Niicksana

Sheriff

Dec 4th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.93 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 Sheriff
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             // Exam - 17 September 2017
  14.             int n = int.Parse(Console.ReadLine());
  15.  
  16.             int dotsFirst = ((3 * n) - 1) / 2;
  17.             int dotsLast = ((3 * n) - 3) / 2;
  18.  
  19.             Console.Write(new string('.', dotsFirst));
  20.             Console.Write("x");
  21.             Console.WriteLine(new string('.', dotsFirst));
  22.  
  23.             Console.Write(new string('.', dotsLast));
  24.             Console.Write("/");
  25.             Console.Write("x");
  26.             Console.Write(@"\");
  27.             Console.WriteLine(new string('.', dotsLast));
  28.  
  29.             Console.Write(new string('.', dotsLast));
  30.             Console.Write("x");
  31.             Console.Write("|");
  32.             Console.Write("x");
  33.             Console.WriteLine(new string('.', dotsLast));
  34.  
  35.             int Xes = n;
  36.             int dots = ((3 * n) - ((2 * n) + 1)) / 2;
  37.             for (int i = 1; i <= n; i++)
  38.             {
  39.                 Console.Write(new string('.', dots));
  40.                 Console.Write(new string('x', Xes));
  41.                 Console.Write("|");
  42.                 Console.Write(new string('x', Xes));
  43.                 Console.WriteLine(new string('.', dots));
  44.                 dots--;
  45.                 Xes++;
  46.                 if (dots == - 1)
  47.                 {
  48.                     break;
  49.                 }
  50.             }
  51.  
  52.             dots += 2;
  53.             Xes -= 2;
  54.             for (int i = 1; i <= (n / 2); i++)
  55.             {
  56.                 Console.Write(new string('.', dots));
  57.                 Console.Write(new string('x', Xes));
  58.                 Console.Write("|");
  59.                 Console.Write(new string('x', Xes));
  60.                 Console.WriteLine(new string('.', dots));
  61.                 dots++;
  62.                 Xes--;
  63.             }
  64.  
  65.             Console.Write(new string('.', dotsLast));
  66.             Console.Write("/");
  67.             Console.Write("x");
  68.             Console.Write(@"\");
  69.             Console.WriteLine(new string('.', dotsLast));
  70.  
  71.             Console.Write(new string('.', dotsLast));
  72.             Console.Write(@"\");
  73.             Console.Write("x");
  74.             Console.Write("/");
  75.             Console.WriteLine(new string('.', dotsLast));
  76.  
  77.             int xes = n;
  78.             int Dots = ((3 * n) - ((2 * n) + 1)) / 2;
  79.             for (int i = 1; i <= n; i++)
  80.             {
  81.                 Console.Write(new string('.', Dots));
  82.                 Console.Write(new string('x', xes));
  83.                 Console.Write("|");
  84.                 Console.Write(new string('x', xes));
  85.                 Console.WriteLine(new string('.', Dots));
  86.                 Dots--;
  87.                 xes++;
  88.                 if (Dots == -1)
  89.                 {
  90.                     break;
  91.                 }
  92.             }
  93.  
  94.             Dots += 2;
  95.             xes -= 2;
  96.             for (int i = 1; i <= (n / 2); i++)
  97.             {
  98.                 Console.Write(new string('.', Dots));
  99.                 Console.Write(new string('x', xes));
  100.                 Console.Write("|");
  101.                 Console.Write(new string('x', xes));
  102.                 Console.WriteLine(new string('.', Dots));
  103.                 Dots++;
  104.                 xes--;
  105.             }
  106.  
  107.             Console.Write(new string('.', dotsLast));
  108.             Console.Write("x");
  109.             Console.Write("|");
  110.             Console.Write("x");
  111.             Console.WriteLine(new string('.', dotsLast));
  112.  
  113.             Console.Write(new string('.', dotsLast));
  114.             Console.Write(@"\");
  115.             Console.Write("x");
  116.             Console.Write("/");
  117.             Console.WriteLine(new string('.', dotsLast));
  118.  
  119.             Console.Write(new string('.', dotsFirst));
  120.             Console.Write("x");
  121.             Console.WriteLine(new string('.', dotsFirst));
  122.         }
  123.     }
  124. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement