2022.1.18
题目网址:
https://acs.jxnu.edu.cn/problem/CF1B
原题:
Spreadsheet
10000ms 65536K
描述:
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.
输入:
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 .
输出:
Write n lines, each line should contain a cell coordinates in the other numeration system.
翻译:
描述:
在受欢迎的电子表格体系中(例如,在Excel中)以下列的计数被用到。第一列有数字A,第二-数字B,等等。第26列数字标记为Z。然后现在这儿有两个字母:列27是数字AA,列28是AB,列52标记为AZ。在ZZ之后是3个字母的数字,等等。
每一行被标记为由1开始的整数。单元格名称由行和列组成。例如,BC23是在55列,23行的单元格的名字。有时候另一个计数系统也会被使用:RXCY,这里的X和Y是整数,分别代表着列和行数。例如,R23C55是前一个例子的单元格的名字。
你的任务是去写一个能读出被给的单元格坐标序列并且可以根据另一个计数体系规则产生每个对应的项目名的程序。
输入:
输入的第一行包含了整数n(1<=n<=10^5),是测试坐标样例的数量。接下来的n行,每行包含一个坐标。所有的坐标都是正确的,所有单元格的行或者列都不超过10^6。
输出:
写下n行,每行应该包含在另一个计数系统对应的这个单元格坐标。