DEV Community

loading...

Standard input for AtCoder Contest (Python3)

Yuta Goto
hello
・1 min read

Alt Text

https://atcoder.jp

String

# ex: hello
s = input()
print(s) # => "hello"

Number

# ex: 10
n = int(input())
print(n + 1) # => 11

Multiple String

# ex: hello world
s1, s2 = input().split()
print(s1) # => "hello"
print(s2) # => "world"

Multiple Number

# ex: 2 3
a, b = map(int, input().split())
print(a * b) # => 6
# ex: 1 2 3 4 5 6 7 8 9 10
l = [ int(x) for x in input().split() ]
print(sum(l)) # => 55

Discussion (0)