Advertisement
rado8506

05. Sheriff

Feb 18th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.02 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 ConsoleApp27
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.             string dots = new string('.', (3 * n) / 2);
  15.             string dots1 = new string('.', ((3 * n) / 2)-1);
  16.             Console.WriteLine("{0}x{0}", dots);
  17.             Console.WriteLine("{0}/x\\{0}", dots1);
  18.             Console.WriteLine("{0}x|x{0}", dots1);
  19.             int dotsCicle = n / 2;
  20.             int Xcicle = n;
  21.             for (int i = 0; i < (n/2)+1; i++)
  22.             {    
  23.                 Console.WriteLine("{0}{1}|{1}{0}", new string('.', dotsCicle), new string('x', Xcicle));
  24.                 dotsCicle--;
  25.                 Xcicle++;
  26.             }
  27.             dotsCicle = 1;
  28.             Xcicle = ((3 * n))/2 - dotsCicle;
  29.             for (int i = n/2; i >=1; i--)
  30.             {
  31.                 Console.WriteLine("{0}{1}|{1}{0}", new string('.', dotsCicle), new string('x', Xcicle));
  32.                 dotsCicle++;
  33.                 Xcicle--;
  34.             }
  35.             Console.WriteLine("{0}/x\\{0}", dots1);
  36.             Console.WriteLine("{0}\\x/{0}", dots1);
  37.  
  38.             dotsCicle = n / 2;
  39.             Xcicle = n;
  40.             for (int i = 0; i < (n / 2) + 1; i++)
  41.             {
  42.                 Console.WriteLine("{0}{1}|{1}{0}", new string('.', dotsCicle), new string('x', Xcicle));
  43.                 dotsCicle--;
  44.                 Xcicle++;
  45.             }
  46.             dotsCicle = 1;
  47.             Xcicle = ((3 * n)) / 2 - dotsCicle;
  48.             for (int i = n / 2; i >= 1; i--)
  49.             {
  50.                 Console.WriteLine("{0}{1}|{1}{0}", new string('.', dotsCicle), new string('x', Xcicle));
  51.                 dotsCicle++;
  52.                 Xcicle--;
  53.             }
  54.             Console.WriteLine("{0}x|x{0}", dots1);
  55.             Console.WriteLine("{0}\\x/{0}", dots1);
  56.             Console.WriteLine("{0}x{0}", dots);
  57.         }
  58.     }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement