编程英语翻译2

https://acs.jxnu.edu.cn/external/gym/doc/GYM100001A.doc

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.

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.

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.

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.

Input

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 .

Output

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

Sample test(s)

input

2

R23C55

BC23

output

BC23

R23C55

中文翻译:

在流行的电子表格中(例如:Excel),使用以下列数,第一列有效数字A,第二列有效数字B,以此类推,直到第26列用Z标记。然后有两个子没有数字,第27列有数字AA,28为AB,第52列为AZ。ZZ之后为三个字母。

行由1开头的整数,名称是由行和列组成,例如,BC23是第55列第23行。

有时使用另一种计算方法:RXCY,其中X,Y是整数,分别显示行号和列号。

你的任务是编写一个程序,读取给定的坐标,根据另一个方法输出结果

输入:

输入的第一行包含啊整数n,即坐标数,然后有n条线,每一条都包含坐标,所有坐标都是正确的,没有列或行大于106的单元

输出:

写n行,每行应包含另一个方法的结果

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值