英语翻译2

https://www.luogu.com.cn/problem/CF1B

题目描述

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 nn ( 1<=n<=10^{5}1<=n<=105 ), the number of coordinates in the test. Then there follow nn 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 10^{6}106.

输出格式

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

在流行的电子表格系统中(例如excel)下面的计算列数的方式被应用。第一列用A第二列用B,以此类推。直到前26列被标记到Z,然后用两个字母来标记。27列为AA28列为AB直到52列为AZ。标记到ZZ后用三个字母来标记,以此类推。

行从整数1开始用整数标记。表格的名字是列和行数字的整合。例如,BC23是第55列第23行处的表格的名字。

有时候另一种计数方式被使用:RXCY。这里的X和Y是整数,分别表示列和行。例如R23C25和之前的例子一样。

你的任务是写一个程序读入给出的坐标表示方式,输出用另一种形式来表示坐标。

第一行输入一个整数n表示要测试的例子组数,接下来n行每行包含一个坐标,所有的坐标都是合法的坐标的行和列数的大小不会超过10^6.

输出n行,每行包含一个用另一种形式表示的坐标

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值