标签:
#include<stdio.h> #include<string.h> #include<string> #include<math.h> #include<algorithm> #define LL long long #define PI atan(1.0)*4 #define DD doublea #define MAX 100100 #define mod 10007 using namespace std; int s[100]; char p[]="ABCDEF"; int op[]={10,11,12,13,14,15}; int main() { int j,i,len,sum,k; LL n,m; while(scanf("%lld",&n)!=EOF) { if(n==0) { printf("0\n"); continue; } k=0; while(n) { s[k++]=n%16; n/=16; } for(i=k-1;i>=0;i--) { if(s[i]<10) printf("%d",s[i]); else { for(j=0;j<6;j++) { if(s[i]==op[j]) printf("%c",p[j]); } } } printf("\n"); } return 0; }
标签:
原文地址:http://www.cnblogs.com/tonghao/p/5131399.html