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

easypeezyproblem
Posted by Minayev {SESC USU} 13 Nov 2014 17:21
My code in Python
from sys import stdin
a=stdin.read()
tab={}
for x in range(256):
    if not chr(x).isalpha():
        tab[x]=32
a=a.translate(tab)
a=a.split()
tram=a.count('tram')
trol=a.count('trolleybus')
if tram>trol:
    print("Tram driver")
elif trol>tram:
    print('Trolleybus driver')
else:
    print('Bus driver')

Edited by author 13.11.2014 17:21