|
|
вернуться в форумTest 6, can anyone help? That's the code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _1612trams_b { class Program { static void Main(string[] args) { string[] sArray = Console.In.ReadToEnd().Split(); char[] separator = { ' ', ',', '.', '\n', '-', ':', '!', '?' }; //string[] sArray = Console.ReadLine().Split(separator); int numTram = 0, numTrol = 0; foreach (string s in sArray) if (s == "tram") numTram++; else if (s == "trolleybus") numTrol++; if (numTram > numTrol) Console.WriteLine("Tram driver"); else if (numTram < numTrol) Console.WriteLine("Trolleybus driver"); else Console.WriteLine("Bus driver"); //Console.Read(); } } } Can anyone tell a test that can go wrong here? |
|
|