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 1601. AntiCAPS

AC! Python 3.3
Posted by DaniilMcrose 16 Nov 2013 15:55
from sys import stdin
from sys import stdout
upper = True
while (True):
    char = stdin.read(1)
    if (not char):
        break;
    elif (65 <= ord(char) <= 90):
        if (upper):
            upper = False
            stdout.write(char)
        else:
            stdout.write(char.lower())
    else:
        stdout.write(char)
        if (char == "." or char == "!" or char == "?"):
            upper = True
Re: AC! Python 3.3
Posted by mberdyshev 13 Jan 2016 00:57
Brackets are unnecessary after while/if.
Re: AC! Python 3.3
Posted by ura 5 Jul 2019 19:37


Edited by author 05.07.2019 19:38
Re: AC! Python 3.3
Posted by ura 5 Jul 2019 19:39
Great program!