FJNU-1159 Fat Brother’s new way
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了FJNU-1159 Fat Brother’s new way相关的知识,希望对你有一定的参考价值。
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.
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.
Output
For each case, output the corresponding string with upper-case letters.
Sample Input
3
17311
2068
37
Sample Output
YOU
CAN
AK
#include <iostream> using namespace std; int main(void) { char opt[20]; int t, a, i; cin >> t; while (t--) { cin >> a; for (i = -1; a--; a /= 26) { opt[++i] = ‘A‘ + a % 26; } while (~i) { putchar(opt[i--]); } cout << endl; } return 0; }
以上是关于FJNU-1159 Fat Brother’s new way的主要内容,如果未能解决你的问题,请参考以下文章
FJNU 1154 Fat Brother And His Love(胖哥与女神)
brother S2A数据采集兄弟S500 CNC监控brother S700实时监控兄弟CNC S1000状态采集