B. Spreadsheets Codeforces Beta Round 1

该编程问题要求将给定的Excel单元格坐标,如A1到AZ100000和R1C1到R100000C100000,按照另一种编号系统(例如RXCY)进行转换。
摘要由CSDN通过智能技术生成

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.

Examples

input

Copy

2
R23C55
BC23

output

Copy

BC23
R23C55

题目大致意思:给两种日期记录模式,让我们相互转换。

日期记录模式一:日期一、字母(26进制,不超过26不进位),日期二、数字。

日期记录模式二:日期二、"R"+数字,日期一、"C"+数字。

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl "\n"

void solve(){
	string s;
	cin >> s;
	ll x,y,a=0,b=0;
	bool f=true,pd=false;
	map<char,ll>mp;
	for(ll i = 0 ; i < s.size() ;  i++)
		if(s[i] >= 'A' && s[i] <= 'Z')mp[s[i]]++;
	if(mp['C'] != 1 || mp['R'] != 1 || mp.size() != 2)f=false;
	if(f)
		for(ll i = 1 ; i < s.size() ; i++)
			if(s[i]>='A' && s[i] <='Z')
				if(s[i-1] >= '0' && s[i-1] <= '9')pd=true;
	if(f && pd){
		x=s.find("R");
		y=s.rfind("C");
		for(ll i = 1 ; i < s.size() ; i ++){
			if(i < y)a=a*10+s[i]-'0';
			else if(i > y)b=b*10+s[i]-'0';
		}
		s="";
		while(b){
			if(b%26 == 0){
				s='Z'+s;
				b--;
			}else s=char('A'+b%26-1)+s;
			b/=26;
		}
		cout << s << a << endl;
	}else{
		for(ll i = 0 ; i < s.size() ; i ++){
			if(s[i] >= 'A' && s[i] <= 'Z')a=a*26+s[i]-'A'+1;
			else b=b*10+s[i]-'0';
		}
		cout << "R" << b << "C" << a << endl;
	}
	return;
}

int main(){
	ll t=1;cin >> t;
	while(t--)solve();
	return 0;
}

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: wps-office-11.1.0.11691-1.aarch64是WPS Office办公软件的一个版本号。它是针对aarch64架构的设备所设计和优化的。 WPS Office是一款功能强大且流行的办公软件套件,包含了Writer、Presentation和Spreadsheets等多种办公应用程序。它具有与微软办公软件完全兼容的特点,因此能够完美地处理和编辑Microsoft Office文件。 这个版本号中的"aarch64"表示该软件适用于64位ARM架构的设备。ARM架构主要应用于移动设备和嵌入式系统中,如智能手机、平板电脑和物联网设备等。相比较而言,传统的个人电脑多采用x86架构。 使用WPS Office-11.1.0.11691-1.aarch64,用户可以在64位ARM设备上畅快地编写文稿、设计演示文稿以及制作电子表格。该版本会针对不同的ARM处理器进行优化,以提供更好的性能和用户体验。 此外,WPS Office还具有简洁的界面、丰富的功能、灵活的操作和广泛的格式兼容性。用户不仅能够创建和编辑各种类型的文档,还能够实现在线共享、云存储以及移动办公等功能。 总之,WPS Office-11.1.0.11691-1.aarch64是专为64位ARM设备而设计的一款办公软件套件,能够满足用户在移动设备上进行办公的需求,并提供高效、方便和可靠的办公体验。 ### 回答2: wps-office-11.1.0.11691-1.aarch64是一款适用于aarch64架构的WPS Office软件版本。WPS Office是一套办公软件套装,包括文字处理、表格计算和演示文稿三个功能模块,广泛应用于个人和商业办公场景。 在这个版本中,WPS Office拥有许多强大的功能和特点。首先,文字处理模块提供了丰富的格式设置选项、字体样式、排版工具等,能够满足不同用途的文档编辑需求。表格计算模块支持复杂的数学运算和数据分析,可创建各种类型的表格和图表,方便进行数据处理和统计工作。演示文稿模块提供了多种幻灯片设计模板、动画效果和多媒体插入功能,可以制作出生动、有吸引力的演示文稿。 此外,WPS Office还支持多种文件格式的导入和导出,与Microsoft Office兼容性较好,可以无缝转换和编辑PPT、DOC、XLS等文件。同时,WPS Office具有云存储功能,可将文档存储在云端,并支持多设备之间的同步和共享,方便用户在不同设备上进行办公。 总体来说,wps-office-11.1.0.11691-1.aarch64是一款功能全面、易于使用的办公软件,适用于aarch64架构的设备。通过使用WPS Office,用户可以高效地处理文字、制作表格和设计演示文稿,提高办公效率,满足各种办公需求。 ### 回答3: wps-office-11.1.0.11691-1.aarch64是一款适用于aarch64架构的WPS办公软件版本。WPS办公软件是一款常用的办公软件套件,包括文字处理、表格处理和演示文稿制作。 WPS办公软件具有类似于Microsoft Office的功能,而且界面简洁、易于使用。它提供了丰富的文档处理工具,如字体样式调整、段落格式设置、表格创建和编辑、图表制作、图像插入等等。另外,WPS办公软件还支持多种文档格式,如doc、docx、xls、xlsx、ppt等,可以与Microsoft Office完美兼容,方便用户之间的互相使用和共享。 对于aarch64架构的设备,WPS办公软件的适配版本能够更好地利用该架构的特性进行优化,提供更高效的办公体验。用户可以通过下载并安装wps-office-11.1.0.11691-1.aarch64版本的软件包来使用WPS办公软件。 总之,wps-office-11.1.0.11691-1.aarch64是一款适用于aarch64架构设备的WPS办公软件版本,提供强大的办公功能和用户友好的界面,可以满足用户对于办公软件的需求,让办公工作更加高效和便捷。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值