wingman007

BasicsExamLocalElections

Dec 12th, 2015
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.43 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. class LocalElections
  5. {
  6.     static void Main()
  7.     {
  8.         // input
  9.         int totalCandidates = int.Parse(Console.ReadLine()); // 10; // 3; // byte.Parse(Console.ReadLine());
  10.         int vote = int.Parse(Console.ReadLine()); // 4; // 1; // byte.Parse(Console.ReadLine());
  11.         char symbol = (char)Console.Read();  //'V'; // 'x';// (char)Console.Read();
  12.  
  13.         // output
  14.         // Console.WriteLine(new string('.', 13));
  15.         for (int i = 1; i <= totalCandidates; i++)
  16.         {
  17.             Console.WriteLine(".............");
  18.             Console.WriteLine("...+-----+...");
  19.             if (i == vote && (symbol == 'X' || symbol == 'x'))
  20.             {
  21.                 Console.WriteLine("...|.\\./.|...");
  22.                 Console.WriteLine("{0:00}.|..X..|...", i);
  23.                 Console.WriteLine("...|./.\\.|...");
  24.             }
  25.             else if (i == vote && (symbol == 'V' || symbol == 'v'))
  26.             {
  27.                 Console.WriteLine("...|\\.../|...");
  28.                 Console.WriteLine("{0:00}.|.\\./.|...", i);
  29.                 Console.WriteLine("...|..V..|...");
  30.             }
  31.             else {
  32.                 Console.WriteLine("...|.....|...");
  33.                 Console.WriteLine("{0:00}.|.....|...", i);
  34.                 Console.WriteLine("...|.....|...");
  35.             }
  36.             Console.WriteLine("...+-----+...");
  37.         }
  38.         Console.WriteLine(".............");
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment