题解 | #进制A+B#
进制A+B
http://www.nowcoder.com/practice/6187581174ac48278ca3bccf8d534897
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner in = new Scanner(System.in); String str = in.nextLine(); String []a = str.split("[ ]"); int c = Integer.parseInt(a[0].substring(2,a[0].length()),16); int d = Integer.parseInt(a[1].substring(1,a[1].length()),8); int e = c+d; System.out.println(e); } } 把进制标志位去掉也就是用substring方法获取后面那一节字符串0x后面,和0后面