题解 | 进制转换
#include <stdio.h> #include<string.h> int main() { char a[100]; while(scanf("%s",a)!=EOF){ int temp=0; for(int i=2;i<strlen(a);i++){ if(isdigit(a[i])) temp=temp*16+(a[i]-48); else temp=temp*16+(a[i]-65+10); } printf("%d\n",temp); } return 0; }