不好意思 应该是78 打错了
===========深入<----------------->浅出============
#include <stdio.h> #include <string.h> #define next(v) ((v) == 0 ? 25 : (v) - 1) void swap(char * p1, char * p2) { char tmp = *p1; *p1 = *p2; *p2 = tmp; } void reverse(char * str) { int i, j, k = strlen(str); for (i = 0, j = k - 1; i < j; i++, j--) swap(str + i, str + j); } int main(void) { unsigned n, i = 0; char buffer[100]; scanf("%u", &n); buffer[i++] = next(n % 26) + 'A'; if(n != 26) while (n /= 26) buffer[i++] = next((n % 26 ? n : n - 1) % 26) + 'A'; buffer[i] = '\0'; reverse(buffer); printf("%s\n", buffer); return 0; }
#include "stdafx.h" void fun(int b){ if(b>9){ fun(b/10); } int c = b%10; if(c==0) printf("0"); else{ printf("%c",c+'A'-1); } } int main(){ int a = 0,temp; while(a<200){ printf("%d\t:",a); if(a<=26){ printf("%c\n",a+'A'-1); } else{ temp = (int(a/26)); fun(temp); printf("%c",a%26+'A'-1); printf("\n"); } a++; } return 0; }都说的这么明白了 进制转换 ,还非得别人写个完整的