String Number Add
Programming Interview
Easy
4 views
Problem Description
A number is provided as a string x and an integer y is provided. Convert x to int and output x+y.
Input Format
One line: x y.
Output Format
One integer result.
Constraints
x is a valid integer string, -10^18
Official Solution
import sys
p=sys.stdin.read().strip().split()
if not p: sys.exit(0)
x=int(p[0])
y=int(p[1])
sys.stdout.write(str(x+y))
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!