Advertisement
fbinnzhivko

Problem03LocalElections

Apr 22nd, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.40 KB | None | 0 0
  1. using System;
  2. class Problem03LocalElections
  3. {
  4.     static void Main()
  5.     {
  6.         int candidates = int.Parse(Console.ReadLine());
  7.         int chosenOne = int.Parse(Console.ReadLine());
  8.         string symbol = Console.ReadLine();
  9.         Console.WriteLine(new string('.', 13));
  10.  
  11.         for (int i = 1; i <= candidates; i++)
  12.         {
  13.             Console.WriteLine("...+{0}+...", new string('-', 5));
  14.  
  15.             if (i == chosenOne)
  16.             {
  17.                 if (symbol.ToLower() == "x")
  18.                 {
  19.                     Console.WriteLine("...|.\\./.|...");
  20.                     Console.WriteLine("{1}.|..{0}..|...", symbol.ToUpper(), i.ToString().PadLeft(2, '0'));
  21.                     Console.WriteLine("...|./.\\.|...");
  22.                 }
  23.                 else
  24.                 {
  25.                     Console.WriteLine("...|\\.../|...");
  26.                     Console.WriteLine("{0}.|.\\./.|...", i.ToString().PadLeft(2, '0'));
  27.                     Console.WriteLine("...|..V..|...");
  28.                 }
  29.             }
  30.             else
  31.             {
  32.                 Console.WriteLine("...|.....|...");
  33.                 Console.WriteLine("{0}.|.....|...", i.ToString().PadLeft(2, '0'));
  34.                 Console.WriteLine("...|.....|...");
  35.             }
  36.  
  37.             Console.WriteLine("...+{0}+...", new string('-', 5));
  38.             Console.WriteLine(new string('.', 13));
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement