1B. Spreadsheets
题目大意:
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cstdlib>
using namespace std;
typedef long long LL;
const LL INF = 0xffffff;
const int maxn = ;
const LL MOD = 1e9+;
void Putt(int C)
{
if(C == )
return ;
if(C% == )
Putt((C-)/);
else
Putt(C/);
char ch;
if(C% == )
ch = 'Z';
else
ch = C% + 'A' - ;
printf("%c", ch);
} void ChangeOne(char str[])
{
int R, C;
sscanf(str,"R%dC%d", &R, &C); Putt(C);
printf("%d\n", R);
} void ChangeTow(char str[])
{
int num = , i;
for(i=; str[i] >= 'A' && str[i] <= 'Z'; i++)
{
num = num* + str[i] - 'A' + ;
}
printf("R%sC%d\n",str+i, num);
}
bool Ok(char str[])
{
if(str[] == 'R' && str[] >= '' && str[] <= '')
{
for(int i=; str[i]; i++)
{
if(str[i] == 'C')
return true;
}
}
return false;
} int main()
{
int T;
char str[];
scanf("%d", &T);
while(T--)
{
cin >> str; if(Ok(str))
ChangeOne(str);
else
ChangeTow(str); }
return ;
}
/*
26 Z
27 AA
53 BA
BZ 78
CA 79
*/
1B. Spreadsheets的更多相关文章
- 【题解】codeforces 1B Spreadsheets
题意翻译 人们常用的电子表格软件(比如: Excel)采用如下所述的坐标系统:第一列被标为A,第二列为B,以此类推,第26列为Z.接下来为由两个字母构成的列号: 第27列为AA,第28列为AB-在标为 ...
- codeforces 1B Spreadsheets
In the popular spreadsheets systems (for example, in Excel) the following numeration of columns is u ...
- CodeForces 1B Spreadsheets (字符串处理,注意细节,大胆尝试)
题目 注意模后余数为0时,要把除以26后的新数据减1,为什么这样,要靠大胆尝试.我在对小比赛中坑了一下午啊,直到比赛结束也没写出这道题....要死了.. #include<stdio.h> ...
- 【Codeforces 1B】Spreadsheets
[链接] 我是链接,点我呀:) [题意] A~Z分别对应了1~26 AA是27依次类推 让你完成双向的转换 [题解] 转换方法说实话特别恶心>_< int转string 得像数位DP一样一 ...
- WeisEditor 3.2.1B 使用说明 [源码下载]
WeisEditor 使用说明 1. 首先打开(Weiseditor)编辑器文件夹下js/config.js 如果此时你的项目是一个虚拟目录项目 WeisConfig.isVirtualPath = ...
- cf------(round)#1 B. Spreadsheets(模拟)
B. Spreadsheets time limit per test 10 seconds memory limit per test 64 megabytes input standard inp ...
- CF Spreadsheets (数学)
Spreadsheets time limit per test 10 seconds memory limit per test 64 megabytes input standard input ...
- Spreadsheets
很水的一道题,提醒自己要认真,做的头都快晕了.考虑26的特殊情况. D - Spreadsheets Time Limit:10000MS Memory Limit:65536KB 6 ...
- Missing artifact javax.transaction:jta:jar:1.0.1B
下载https://pan.baidu.com/s/1hsfyj8S到某目录,比如: /Users/yintingting/Downloads 打开terminal,cd /Users/yinting ...
随机推荐
- 关于HTTP请求报文和响应报文学习笔记
超文本传输协议(Hypertext Transfer Protocol,简称HTTP)是应用层的一种通信协议.它是一种请求/响应式的协议,即一个客户端与服务器建立连接后,向服务器发送一个请求;服务器接 ...
- java 基本类型和包装类的比较
public class BoxingTest { @Test public void test1(){ String a = new String("1"); String b ...
- 最简单的基于FFmpeg的推流器(以推送RTMP为例)
===================================================== 最简单的基于FFmpeg的推流器系列文章列表: <最简单的基于FFmpeg的推流器(以 ...
- saiku
1.saiku下载http://community.meteorite.bi/可以下载各个版本的源代码 2.下载到 saiku-latest.zip 3.解压运行比较简单 解压出来的目录: ...
- 13号中断 int 13(转)
第一部分 简 介 1,1 一. 硬盘结构简介 1. 硬盘参数释疑 到目前为止, 人们常说的 ...
- magento站点还原到本地
问题描述 首先将网站文件夹解压到xampp/htdocs/wenjianjia目录下,然后替换sql文件里的域名为localhost/wenjianjia.然后访问前台,正常.访问后台,出问题了 Ma ...
- jquery元素查找方法集锦
jQuery常用的元素查找方法总结 $("#myELement") 选择id值等于myElement的元素,id值不能重复在文档中只能有一个id值是myElement所以得到 ...
- js打开新的窗体不被浏览器阻止
转载自js弹出新窗口而不会被浏览器阻止的方法有时候希望可以用js另开新窗口,但用window.open方法打开窗口总是被浏览器阻止, 可以用下面的方法打开新窗口而不会遭到拦截 1.新添加一个Form ...
- Linux——搭建PHP开发环境第三步:mysql
原文链接:http://www.jb51.net/article/83647.htm 1.第一步就是看linu是否安装了mysql,经过rpm -qa|grep mysql查看到centos下安装了m ...
- BZOJ 1019 汉诺塔
Description 汉诺塔由三根柱子(分别用A B C表示)和n个大小互不相同的空心盘子组成.一开始n个盘子都摞在柱子A上,大的在下面,小的在上面,形成了一个塔状的锥形体. 对汉诺塔的一次合法的操 ...