# include <stdio.h>
int main()
{
//½øÖÆת»»4£º´Ó¼üÅÌÊäÈëÒ»¸ö²»³¬¹ý8λµÄÕýµÄÊ®Áù½øÖÆÊý×Ö·û´®£¬
//½«Ëüת»»ÎªÕýµÄÊ®½øÖÆÊýºóÊä³ö¡£
int i=0,n=0;
char a[10];
unsigned long sum=0;
scanf("%s",a);
n=strlen(a);
for (i=0;i<n;i++)
{
//×¢£ºasciiÂ룺A~65 0~48 //b=a[i];
if (a[i]>='0'&&a[i]<='9')// ÊäÈëµÄÊý·¶Î§ÔÚ0~9
{
sum=sum*16; sum=sum+a[i]-'0';
}
if (a[i]>='A'&&a[i]<='F')// ÊäÈëµÄÊý·¶Î§ÔÚ10~15
{
sum=sum*16;
sum=sum+a[i]-'A'+10;
}
} printf("%u",sum); //-----------------------------------------------------------*/
return 0;}
/*Compiling...
½øÖÆת»¯.cpp
C:\Users\k40\Desktop\2014Äê4ÔÂ3ÈÕ\½øÖÆת»¯.cpp(11) : error C2065: 'strlen' : undeclared identifier
Error executing cl.exe.
½øÖÆת»¯.exe - 1 error(s), 0 warning(s)
*/