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 ...
随机推荐
- Java设计模式02:常用设计模式之工厂模式(创建型模式)
一.工厂模式主要是为创建对象提供过渡接口,以便将创建对象的具体过程屏蔽隔离起来,达到提高灵活性的目的. 工厂模式在<Java与模式>中分为三类: 1)简单工厂模式(Simple Fact ...
- CentOS6安装配置rsh
基本信息:节点一:ip:192.168.8.166 主机名:hadrtest01节点二:ip:192.168.8.250 主机名:hadrtest02 1.两节点分别安装rsh,rsh-server包 ...
- java之log4j的配置
java之log4j的配置 log4j有很多的优点,用起来很方便,就是配置起来有些麻烦,下面我介绍一下log4j的配置方法. log4j是用来记录日志的. 软件的运行过程离不开日志.日志主要用来记录系 ...
- nopi导入导出
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- Spot light工具集
Spot light on UNIX 安装没什么问题 Spot light on Oracle 必须安装32位的客户端,不然搞死你 两者的界面都是吊炸天啊
- 玩转CSLA.NET小技巧系列二:使用WCF无法上传附件,提示413 Entity Too Large
背景:由于系统需要展示图片,客户上传图片到本地客户端目录,然后在数据库中存储本地图片地址,和图片二进制数据 错误原因:我是使用CSLA的WCF服务,使用了数据门户,WCF协议使用的是wsHttpBin ...
- SGU 176.Flow construction (有上下界的最大流)
时间限制:0.5s 空间限制:4M 题意: 有一个由管道组成的网络,有n个节点(n不大于100),1号节点可以制造原料,最后汇集到n号节点.原料通过管道运输.其中有一些节点有管道连接,这些管道都有着最 ...
- TextView控件
1.手动创建(不建议): TextView tv = new TextView(this); tv.setContent("你好"); setContentView(tv); 2. ...
- CentOS7开机启动管理systemd简介及使用
systemd提供更优秀的框架以表示系统服务间的依赖关系实现系统初始化时服务的并行启动,同时达到降低Shell的系统开销的效果systemd的目标是:尽可能启动更少进程:尽可能将更多进程并行启动.sy ...
- 入门1:PHP的优点
一.语法简单 二.学习成本低 (因为语法简单 所以学习成本低) 三.开发效率高 (PHP运行流程很简单,语法也很简单,必然开发效率就高) 四.跨平台 (我们只需要写一份PHP的程序,就可以非常方便的把 ...