JAVA朴素解法
进制转换
http://www.nowcoder.com/questionTerminal/8f3df50d2b9043208c5eed283d1d4da6
import java.util.*; import java.io.*; public class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String in; while((in = br.readLine())!=null){ System.out.println(getOc(in)); } } public static int getOc(String in){ int res=0; for(int i=2;i<in.length();i++){ int tmp=getOK(in.charAt(i)); res=res*16+tmp; } return res; } public static int getOK(char ch){ if(ch>='0'&&ch<='9'){ return (int)ch - (int)('0'); }else if(ch>='a'&&ch<='z'){ return (int)ch - (int)('a')+10; }else{ return (int)ch - (int)('A')+10; } } }