你的编译器得支持64位整形数才行。这样的话long long就是64位的数,输出可改为:printf("0X%016LLX",b);否则的话只能变通一下:if(b<0)printf("0XFFFFFFFF%8X",b);else printf("0X%016X",b);
int main(){ int a;scanf("%x",&a);printf("%x\n",0xffff00ff|a);return 0;}
include<stdio.h>void main() { unsigned char str[256],*a,c; int b; a=str; scanf("%s",a); b=0; while ( *a ) { c=*a; b*=16; if ( c>='0' && c<='9' ) b+=c-'0'; else if ( c>='a' && c<='f' ) b+=10+c-'a'; else if ( ...