进制转换,注意要加getchar()
#include <stdio.h>
#include <string.h>
char s[]={"ZABCDEFGHIJKLMNOPQRSTUVWXY"};
int str[]={26,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
int r, c, sum[20];
char t1,t2;
int main()
{
while ( scanf("%c%d%c%d", &t1, &r, &t2, &c) != EOF && r&&c )
{
memset(sum, 0, sizeof(sum));
int k=0;
getchar();
while ( c )
{
sum[k++]= c%26;
c=(c-str[sum[k-1]])/26;
}
for ( int i = k-1; i >= 0; i-- )
printf("%c", s[sum[i]]);
printf("%d\n", r);
}
return 0;
}