神奇的编码 
Description 
假如没有阿拉伯数字,我们要怎么表示数字呢  
小明想了一个方法如下:  
1 -> A  
2 -> B  
3 -> C  
….  
25 -> Y  
26 -> Z  
27 -> AA
28 -> AB 
…. 
现在请你写一个程序完成这个转换
Input 
输入的第一个数为一个正整数T,表明接下来有T组数据。  
每组数据为一个正整数n ( n <= 1000)
Output 
对于每个正整数n,输出他对应的字符串
Sample Input 
3 
1 
10 
27 
Sample Output 
A 
J 
AA
进制转换?
#include <stdio.h>    
#include <iostream>    
#include <math.h>    
#include <stdlib.h>    
#include <ctype.h>    
#include <algorithm>    
#include <vector>    
#include <string.h>    
#include <queue>    
#include <stack>    
#include <set>     
#include <sstream>    
#include <time.h>    
#include <utility>    
#include <malloc.h>    
#include <stdexcept>    
#include <iomanip>    
#include <iterator>  
using namespace std;
int main()
{
    int n,t;
    scanf("%d",&t);
    while (t--)
    {
        scanf("%d",&n);
        if (n <= 26)
            printf("%c\n", ‘A‘ + n - 1);
        else if (n <= 26 * 26 + 26)
        {
            n -= 27;
            int t = n / 26;
            printf("%c", ‘A‘ + t);
            n = n % 26;
            printf("%c\n", ‘A‘ + n);
        }
        else
        {
            n -= 27 + 26 * 26;
            printf("%c%c%c\n", ‘A‘ + char(n / 26 / 26), ‘A‘ + char((n / 26) % 26), ‘A‘ + char(n % 26));
        }
    }
    return 0;
}原文:http://blog.csdn.net/u014427196/article/details/44313217