ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

英文题目翻译day2

2022-01-18 14:31:14  阅读:227  来源: 互联网

标签:BC23 题目 column day2 number coordinates cell numbers 英文


Spreadsheets(电子表格)

每次测试时间限制:10秒   

每次测试存储限制:64Mb

输入:标准输入

输出:标准输出

在流行的电子表格系统中(例如,在Excel中)对columns列使用了如下的计数规则。第1列记为A,第2列记为B,以此类推。知道第26列被标记为Z。接下来有两个记数字母:第27列记为AA,第28列为AB,第52列被标记为AZ。ZZ之后接着采用三个记数字母,以此类推。

Rows(行)从整数1开始标记。Cell(单元格)的名称由列和行计数规则组成。例如,BC23是第55列,第23行的单元格名称。

有时则采用另一种计数规则:RXCY,X和Y表示整数,依次显示出列数和行数。例如,R23C55是先前单元格的表示。

你的任务是编写一个程序,读取所给的每个sequence of cell coordinates(单元坐标序列)并且通过另一种计数方式输出。

输入

第一行输入包含一个整数n(1<=n<=1e5),为测试coordinates(坐标)的数量。接下来有n行,每行包含一个坐标。所有的坐标应保证合法,单元格的列数和行数不超过1e6。

输出

输出n行,每行应该包含一个采用另一种计数方式的单元格坐标。

样例测试

输入

2

R23C55

BC23

输出

BC23

R23

C55

Spreadsheets

time limit per test: 10 seconds

memory limit per test: 64 megabytes

input: standard input

output: standard output

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

标签:BC23,题目,column,day2,number,coordinates,cell,numbers,英文
来源: https://blog.csdn.net/m0_59781472/article/details/122559369

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有