|
|
back to boardC# Posted by Gregory 24 Jul 2012 17:29 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace timusPin { class Program { static void Main(string[] args) { int max; int e=0, m=0, l=0; max = int.Parse(Console.ReadLine()); string[] arr = new string[max]; for (int v = 0;v <= max -1 ;v++) { arr[Convert.ToInt32(v)] = (Console.ReadLine()); } for (int v = 0;v <= max -1 ;v++) { if (arr[v] == "Emperor Penguin") { e++; } if (arr[v] == "Macaroni Penguin") { m++; } if (arr[v] == "Little Penguin") { l++; } } if (e > m && e > l) { Console.WriteLine("Emperor Penguin"); } if (m > e && m > l) { Console.WriteLine("Macaroni Penguin"); } if (l > e && l > m) { Console.WriteLine("Macaroni Penguin"); } // Console.ReadKey(); } } } WHY Wrong Answer???? Re: C# Posted by K-2 19 Jan 2013 17:20 if (l > e && l > m) { Console.WriteLine("Little Penguin"); } |
|
|