-->
当前位置:首页 > 题库

PROGRAMMING:Excel column name and column number conversion

Luz5年前 (2021-05-10)题库399
Have you noticed the rule of listing in excel? It's like this: < br >
`A B C ... Y Z AA AB AC ... AY AZ BA BB BC ... BY BZ ... ZZ ... AAA ...`

If you don't understand it, please open the EXCEL program and observe it carefully ~ ~ < br > please
Each column is numbered from '1', that is, the columns' a B C... Y Z AA AB... 'are numbered from' 1 23... 25 26 27 28... '< br > in sequence
Now, please write a program to convert the input column name and column number according to the above rules (regardless of the maximum number of columns actually allowed by Excel software).
###Input format:
The input consists of several lines, each of which contains one of the following three types:
*A string of uppercase letters up to 6 in length, representing a column name
*A positive integer with no more than 9 digits representing a column ordinal number
*The symbol "#" indicates the end of input
###Output format:
For each row input that appears before the input terminator '#', if the input is a column name, the corresponding column number will be printed in one row; If the input is column number, the corresponding column name will be printed in one row.
###Input example:
```in
A
three
AB
twenty-nine
#
```
###Output example:
```out
one
C
twenty-eight
AC
```







answer:If there is no answer, please comment