2019 cattle off the holiday season team 3 - New cow IDs

Creative Commons License Copyright: Attribution, allow others to create paper-based, and must distribute paper (based on the original license agreement with the same license Creative Commons )

Links: https://ac.nowcoder.com/acm/contest/945/B
Source: Cattle-off network

Title Description

Bessie’s bovine thought processes occasionally take her into mathematical realms unfathomed by her barn-mates.
She watched the cows walk by with their serial numbers (1 <= serial_number <= 999,999) on display. She thought perhaps the numbers might have more interesting properties if one calculated the sum of the number and the reverse of that number. Help her perform this calculation.
Here are some examples:
.
23 + 32 = 55
123 + 321 = 444
9730 + 379 = 10109

Enter a description:

Line 1: A single integer that is the serial number to be transformed

Output Description:

Line 1: A single integer that is the transformed serial number

。。。。。。。。。

... AC Code (Python Dafa is good!)

a = input()
print(int(a)+int(a[::-1]))

Guess you like

Origin blog.csdn.net/weixin_44090305/article/details/93598262
Recommended