HDOJ(HDU) 1720 A+B Coming(进制)

简介: HDOJ(HDU) 1720 A+B Coming(进制)

Problem Description

Many classmates said to me that A+B is must needs.

If you can’t AC this problem, you would invite me for night meal. ^_^


Input

Input may contain multiple test cases. Each case contains A and B in one line.

A, B are hexadecimal number.

Input terminates by EOF.


Output

Output A+B in decimal number in one line.


Sample Input

1 9

A B

a b


Sample Output

10

21

21


超简单的题目,,,就是给2个16进制的数,将它们的和按10进制输出!

JAVA可以直接读取16进制的数!

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int a = sc.nextInt(16);
            int b = sc.nextInt(16);
            System.out.println(a+b);
        }
    }
}
目录
相关文章
HDOJ(HDU) 1570 A C
HDOJ(HDU) 1570 A C
110 0
HDOJ(HDU) 1570 A C
HDOJ 1335 Basically Speaking(进制转换)
HDOJ 1335 Basically Speaking(进制转换)
101 0
|
索引
HDOJ/HDU 2567 寻梦(字符串简单处理)
HDOJ/HDU 2567 寻梦(字符串简单处理)
122 0
HDOJ(HDU) 2317 Nasty Hacks(比较、)
HDOJ(HDU) 2317 Nasty Hacks(比较、)
109 0
|
Java 测试技术
HDOJ(HDU) 1877 又一版 A+B(进制、、)
HDOJ(HDU) 1877 又一版 A+B(进制、、)
102 0
|
存储
HDOJ/HDU 2140 Michael Scofield's letter(字符转换~)
HDOJ/HDU 2140 Michael Scofield's letter(字符转换~)
89 0
HDOJ(HDU) 2161 Primes(素数打表)
HDOJ(HDU) 2161 Primes(素数打表)
119 0
|
Java
HDOJ(HDU) 2164 Rock, Paper, or Scissors?
HDOJ(HDU) 2164 Rock, Paper, or Scissors?
124 0
HDOJ(HDU) 4847 Wow! Such Doge!(doge字符统计)
HDOJ(HDU) 4847 Wow! Such Doge!(doge字符统计)
134 0
|
安全 数据安全/隐私保护
HDOJ/HDU 1039 Easier Done Than Said?(字符串处理~)
HDOJ/HDU 1039 Easier Done Than Said?(字符串处理~)
114 0