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 1226. esreveR redrO

why WA10 ?
Posted by Lev_Kireenko 🐬 29 Jul 2016 18:24
python 3

my code :

import sys
for t in sys.stdin :
        s = ''
        for i in range(len(t)):
                if (ord(t[i]) >=97 and ord(t[i]) <= 122) or (ord(t[i])>=65 and ord(t[i])<=90):
                        s += t[i]
                else :
                        if len(s) > 0 :
                                print(s[len(s)-1:0:-1]+s[0], end='')
                                s = ''
                        print(t[i], end='')
        print(s, end='')


Edited by author 29.08.2016 01:57