ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1612. Tram Forum

Test 6, can anyone help?
Posted by Markfryazino 6 Sep 2018 01:01
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?