1.18 Spreadsheet

描述:

In the popular spreadsheets systems (for example, in Excel) the following numeration of columns is used. The first column has number A, the second — number B, etc. till column 26 that is marked by Z. Then there are two-letter numbers: column 27 has number AA, 28 — AB, column 52 is marked by AZ. After ZZ there follow three-letter numbers, etc.

在最近很火热的电子表格系统(例如Excel),使用了一下列数。第一列记作A,第二个记作B等。直到第二十六列记为Z。然后使用两个字母来计数:第27列用AA,28——AB,直到第52列用AZ计数。在ZZ之后用3个字母计数等。

The rows are marked by integer numbers starting with 1. The cell name is the concatenation of the column and the row numbers. For example, BC23 is the name for the cell that is in column 55, row 23.

行数是用从整数1开始计数。单元格的名字包括行和列。例如,BC23是55列,23行那一栏。

Sometimes another numeration system is used: RXCY, where X and Y are integer numbers, showing the column and the row numbers respectfully. For instance, R23C55 is the cell from the previous example.

有时,另外的计数系统记作:RXCY,这里的XY是整数,表示整数,分别表示了行和列。例如,R23C55 是前面示例中的单元格。

Your task is to write a program that reads the given sequence of cell coordinates and produce each item written according to the rules of another numeration system.读取

你的任务是写一个程序,读取给定的单元格坐标,并给定另一个系统规则生成每一个项目。

输入:

The first line of the input contains integer number n (1 ≤ n ≤ 105), the number of coordinates in the test. Then there follow n lines, each of them contains coordinates. All the coordinates are correct, there are no cells with the column and/or the row numbers larger than 106 .

第一行输入一个整数n(1<=n<=105),表示测试的组数。接下来有n行,每行包括组数。每一组测试数据都是正确的,没有数据是大于106的。

输出:

Write n lines, each line should contain a cell coordinates in the other numeration system.

输出n行,每一行都包含另一种计数系统中的单元格坐标。

样例输入:

2
R23C55
BC23

样例输出:

BC23
R23C55
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值