一个小问题
有这样一个小程序,我输入后,结果不正确,是什么原因,请各位高手帮忙。#include <stdio.h>
main()
{ unsigned char a,b;
printf("enter a hex numbers:");
scanf("%x",&a);
b=a<<2;
printf("%x",b);
}
enter a hex numbers:8500
结果应该是1400;可是我执行后,在屏幕是只有一个0/
2008-03-12 20:52
2008-03-12 21:19
2008-03-12 21:42
2008-03-12 22:04
2008-03-12 22:19
2008-03-17 21:29