FJNU 1159 Fat Brother’s new way(胖哥的新姿势)
FJNU 1159 Fat Brother’s new way(胖哥的新姿势)
Time Limit: 1000MS Memory Limit: 257792K
|
【Description】 |
【题目描述】 |
|
I bet, except Fat Brothers, all of you don’t like strange way to show integers , he is really like this way to showing integers: 1 -> ‘A’ 2 -> ‘B’ ……. 26 -> ‘Z’ 27 -> ‘AA’ 28 -> ‘AB’ ……. Unfortunately, Fat Brother’s mathematics is poor, so he needs your help, he will give you some integers, and you must transform it with Fat Brother’s way. |
我琢磨着,除了胖哥,没人想用如此奇葩的方式表示整数,可他总喜欢这么来写整数: 1 -> ‘A’ 2 -> ‘B’ ……. 26 -> ‘Z’ 27 -> ‘AA’ 28 -> ‘AB’ ……. 不幸的是,胖哥的数学并不好,因此他需要你的帮助,他会给你一些整数,你必须把他们转化成胖哥的表示方式。 |
|
【Input】 |
【输入】 |
|
Input starts with an integer T(T <= 10000), denoting the number of test case. For each test case, an integers n(1 <= n <= 2147483647) is given. |
输入以一个整数T(T <= 10000)打头,表示测试用例的数量。 对于每个测试用例,都有一个整数n(1 <= n <= 2147483647)。 |
|
【Output】 |
【输出】 |
|
For each case, output the corresponding string with upper-case letters. |
对于每个用例,输出以大写字母组成的字符串。 |
|
【Sample Input - 输入样例】 |
【Sample Output - 输出样例】 |
|
3 17311 2068 37 |
YOU CAN AK |
【题解】
大概意思就是10进制转26进制,不过需要注意输入数据并不是从0开始的。
对了,G++里没有strrev这个函数
【代码 C++】
#include<cstdio>
int main(){
char opt[];
int t, a, i;
scanf("%d", &t);
while (t--){
scanf("%d", &a);
for (i = -; a--; a /= ) opt[++i] = 'A' + a % ;
while (~i) putchar(opt[i--]);
puts("");
}
return ;
}
FJNU 1159 Fat Brother’s new way(胖哥的新姿势)的更多相关文章
- FJNU 1153 Fat Brother And XOR(胖哥与异或)
FJNU 1153 Fat Brother And XOR(胖哥与异或) Time Limit: 1000MS Memory Limit: 257792K [Description] [题目描述] ...
- FJNU 1155 Fat Brother’s prediction(胖哥的预言)
FJNU 1155 Fat Brother’s prediction(胖哥的预言) Time Limit: 1000MS Memory Limit: 257792K [Description] [ ...
- FJNU 1152 Fat Brother And Integer(胖哥与整数)
FJNU 1152 Fat Brother And Integer(胖哥与整数) Time Limit: 1000MS Memory Limit: 257792K [Description] [题 ...
- FJNU 1156 Fat Brother’s Gorehowl(胖哥的血吼)
FJNU 1156 Fat Brother’s Gorehowl(胖哥的血吼) Time Limit: 1000MS Memory Limit: 257792K [Description] [题目 ...
- FJNU 1151 Fat Brother And Geometry(胖哥与几何)
FJNU 1151 Fat Brother And Geometry(胖哥与几何) Time Limit: 1000MS Memory Limit: 257792K [Description] [ ...
- FJNU 1154 Fat Brother And His Love(胖哥与女神)
FJNU 1154 Fat Brother And His Love(胖哥与女神) Time Limit: 2000MS Memory Limit: 257792K [Description] [ ...
- FJNU 1157 Fat Brother’s ruozhi magic(胖哥的弱智术)
FJNU 1157 Fat Brother’s ruozhi magic(胖哥的弱智术) Time Limit: 1000MS Memory Limit: 257792K [Description ...
- HDU 4637 Rain on your Fat brother 线段与半圆和线段交 简单题
题意: 应该不难读懂. 做法: 我们可以把雨滴看做静止不动,然后maze(这题的那个人)就是往左上方运动就可以了,计算出maze能跑到的最远的点,然后就是求起点和终点所构成的线段与每个雨滴交的时间,注 ...
- 大数据的胖哥的方式(9)- 金融业数据仓库的逻辑模型FS-LDM
介绍: 大数据是不是海市蜃楼,来自小橡子只是意淫奥克斯,大数据的发展,而且要从头开始,基于大数据建设国家.项目-level数据中心行业将越来越多,大数据仅供技术,而非溶液,临数据组织模式,数据逻辑模式 ...
随机推荐
- svn使用相关问题:eclipse插件,加锁,解锁,偷锁,更新不了,记住密码
svn使用相关问题:eclipse插件,加锁,解锁,偷锁,更新不了,记住密码 获取锁的时候可以看下 是谁锁住了,让对方提交解锁,如果是给离职人员锁住需要使用偷锁的方式先解锁再提交偷锁处理办法:选中该文 ...
- 将txt文件数据转成bin文件.
之前用牛逼的绘图以及分析bmp的像素文件的方法, 整理出汉字编码从: 0x4E00到0x9FA5, (维基上说是9FD5, 完了, 回头再更新吧.) https://en.wikipedia.org/ ...
- Pascal's Triangle II
class Solution { public: vector<int> getRow(int rowIndex) { vector<int> v; ) return v; v ...
- php中替换函数主要用的几个函数strtr(),str_repalce()。
php中替换函数主要有strtr(),str_repalce()这两个函数,今天介绍下他们的区别和用法, 先来看看这个php字符串替换函数 strtr()的两种用法: strtr(string,fro ...
- jQuery - AJAX get() 和 post() 方法
jQuery get() 和 post() 方法用于通过 HTTP GET 或 POST 请求从服务器请求数据. 参考网址: http://www.w3cschool.cc/jquery/jquery ...
- spring mvc+myBatis配置详解
一.spring mvc Spring框架(框架即:编程注解+xml配置的方式)MVC是Spring框架的一大特征,Spring框架有三大特征(IOC(依赖注入),AOP(面向切面),MVC(建模M- ...
- linux中利用awk对数组进行排序
数组 在排序前需要对数组有所了解,数组是用于存储一系列值得变量,这些值之间通常是由联系的,可通过索引来访问数组的值,索引需要用括号括起来,基本格式如下: array[index]=value awk数 ...
- 上传文件时,Request报文头不同浏览器会产生不同的content-type
选择一个zip文件上传,用IE看的报文头是image/jpeg,用chrom看是application/octet-stream. 第一次遇到这个类型的content-type,百度了一下, octe ...
- 温故而知新 clone
浅复制(浅克隆) 被复制对象所有变量都含有与原来对象的相同值,对象中对其他对象的引用仍然指向原来的对象,换言之,复制对象只复制考虑的对象,而不复制所引用的对象.继承自java.lang.Object类 ...
- 【转】MYSQL入门学习之三:全文本搜索
转载地址:http://www.2cto.com/database/201212/173873.html 一.理解全文本搜索 www.2cto.com 1.MyISAM支持全文本搜索,而Inn ...