#include int hexToDex(int hex){
int data[20];
int i=0,j=0;
int dec = 0;
do{
data[i++] = hex%16;
hex/=16;
}while(hex >0);
for(j=i-1;j>=0;j--){
if(data[j] <= 9 ){
dec = dec * 10 + data[j];
}else{
dec = -1;
break;
}
}
return dec;
}
int main(int argc, char *argv[])
{
int hex , dec;
while(scanf("%x", &hex) !=EOF){
dec = hexToDex(hex);
if(dec != -1){
printf("0x%x ==> %d\n", hex, dec);
}else{
printf("0x%x ==> error, contain a~f\n", hex);
}
}
return 0;
}
/*
sample input/output:
0x1
0x1 ==> 1
0x23
0x23 ==> 23
0x456
0x456 ==> 456
0x2345
0x2345 ==> 2345
0x12345
0x12345 ==> 12345
0x123456
0x123456 ==> 123456
0x1234567
0x1234567 ==> 1234567
0x12345678
0x12345678 ==> 12345678
0x12f
0x12f ==> error, contain a~f
*/