#include
#include
#include
int flag=1;
//....^....................//
void main()
{int convert(char string[]);
char string[100];
int s;//,flag;
//........^....................//
printf("Please enter a line:\n");
gets(string);
s=convert(string);
if(flag) printf("s(D)=%d.\n",s);
else printf("The number is not a ox.\n");
}
int convert(char string[])
{
int i,s=0,l=0;
for (i=0;i //........^....................//
if(string[i]>='0'&&string[i]<='9')
s=s*16+string[i]-'0';
else if(string[i]>='A'&&string[i]<='F')
s=s*16+string[i]-'A'+10;
else if(string[i]>='a'&&string[i]<='f')
s=s*16+string[i]-'a'+10;
else {flag=0;}
return (s);
}