P30027 [洛谷] [HUSTFC 2023] A+B Problem
普及-
题目描述

Problem Description

Walk Alone is a master of strings. In his eyes, each string represents a number in base 26. Specifically, according to the alphabet order, from 'A' to 'Z', they correspond to the decimal numbers from 0 to 25. For example, 'BA' corresponds to the decimal number 26 (1 × 26 + 0), and 'BB' corresponds to the decimal number 27 (1 × 26 + 1), and so on.

Walk Alone wants to test you, who are accustomed to decimal addition. He gives you two strings \( s \) and \( t \), and asks you to calculate their sum in base 26, i.e., \( s + t \), and report it to him in the form of a string. For example, \( A + A = A \), and \( B + C = D \). To simplify the problem, \( s \) and \( t \) each contain only one uppercase letter, but note that the answer may not necessarily contain only one uppercase letter.

Input Format

A single line containing two uppercase letters separated by a space, representing \( s \) and \( t \) respectively.

Output Format

Output a single line containing an uppercase letter string, representing \( s + t \). The output should not include leading zeros, i.e., outputs like 'AA' or 'AB' are not valid.

Sample Input and Output

Sample Input #1

A A

Sample Output #1

A

Sample Input #2

B C

Sample Output #2

D

Sample Input #3

Z B

Sample Output #3

BA
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
A A
样例输出
A