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基础知识强化之集合框架笔记42:Set集合之LinkedHashSet的概述和使用
1. LinkedHashSet类的概述: • 元素有序唯一 • 由链表保证元素有序 • 由哈希表保证元素唯一 2. 代码示例: package cn.itcast_04; import java.u ...
- codevs 3052 多米诺 二分图匹配
/*codevs 3052 二分图匹配 把矩阵分两批 黑和白 且黑白不相交 这就构成了二分图的两部分 然后求最大匹配*/ #include<cstdio> #include<cstr ...
- webservice 发布到外网的时候
在web.config的<system.web></system.web>中间加入如下配置节内容<webServices> <protoco ...
- 关于URL 解码, 编码
由于近期客户需要用到CA认证,此CA认证采用的是URL方式出传值 使用指定的编码对象将 URL 编码的字符串转换为已解码的字符串. 编码个人理解就是将某字符串以某种方式储存起来,而解码则以其编码格式得 ...
- js获取图片高度
js获取图片高度时经常会获取的图片高度为0,原因是图片未加载完毕.第一次加载时,显示0(火狐等部分浏览器显示24).待加载完毕后,再刷新,显示图片高度258. var oImg = document. ...
- JS cookie 读写操作
/*** ** 功能: cookie操作对象 ***/ var cookies = { /*** ** 功能: 写入cookie操作 ** 参数: name cookie名称 ** value coo ...
- 程序从高版本降到2.0,数据集报错 TypedTableBase
错误 命名空间“System.Data”中不存在类型或命名空间名称“TypedTableBase”(是缺少程序集引用吗?) 解决: 该错误出现在自动生成的XXX.Designer.cs里. .NET ...
- 详细查看数据库SQL执行计划
DBCC DROPCLEANBUFFERS 清除数据缓存DBCC FREEPROCCACHE 清除执行计划缓存 SET SHOWPLAN_XML ON 此语句导致 SQL Server 不执行 Tr ...
- 【POJ3461】【KMP】Oulipo
Description The French author Georges Perec (1936–1982) once wrote a book, La disparition, without t ...
- ROW_NUMBER分页的注意事项
之前在使用ROW_NUMBER分页获取数据的时候,直接用ROW_NUMBER里的SELECT语句查出了所有的数据. like this: select * from ( select row_numb ...