BMU1999's blog

By BMU1999, history, 5 years ago, In English

For exp.: https://www.e-olymp.com/en/contests/12949/problems/123233

How can I write this in Python3?

I searched this on Google but it is not working.

Please help if you can.

  • Vote: I like it
  • -28
  • Vote: I do not like it

| Write comment?
»
5 years ago, # |
  Vote: I like it +26 Vote: I do not like it

There are many ways. For example:

while True:
    try: input_line = input()
    except EOFError: break
    solve(input_line)
»
5 years ago, # |
Rev. 4   Vote: I like it +16 Vote: I do not like it

You can import sys and use sys.stdin iterator: For example,

import sys

for line in sys.stdin:

print(line.rstrip('\n'))