usr bin env python import sys INPUT rev inp def rev num return int str

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python
import sys
INPUT = 'rev.inp'
def rev(num):
return int(str(num)[::-1])
def main(fname):
f = file(fname)
try:
length = int(f.readline())
except ValueError:
print "what a shit"
sys.exit(1)
for i in xrange(length):
one, two = f.readline().split()
print rev(rev(one) + rev(two))
if __name__ == '__main__':
main(INPUT)