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
101 0
HDOJ(HDU) 1570 A C
HDOJ 1335 Basically Speaking(进制转换)
HDOJ 1335 Basically Speaking(进制转换)
97 0
|
Java
HDOJ(HDU) 2164 Rock, Paper, or Scissors?
HDOJ(HDU) 2164 Rock, Paper, or Scissors?
115 0
|
安全 数据安全/隐私保护
HDOJ/HDU 1039 Easier Done Than Said?(字符串处理~)
HDOJ/HDU 1039 Easier Done Than Said?(字符串处理~)
107 0
HDOJ(HDU) 2317 Nasty Hacks(比较、)
HDOJ(HDU) 2317 Nasty Hacks(比较、)
105 0
HDOJ/HDU 2568 前进(简单题)
HDOJ/HDU 2568 前进(简单题)
124 0
HDOJ(HDU) 2153 仙人球的残影(谜一样的题、、、)
HDOJ(HDU) 2153 仙人球的残影(谜一样的题、、、)
114 0
HDOJ1002题A + B Problem II,2个大数相加
HDOJ1002题A + B Problem II,2个大数相加
115 0
|
存储
HDOJ/HDU 1073 Online Judge(字符串处理~)
HDOJ/HDU 1073 Online Judge(字符串处理~)
97 0
HDOJ 2031 进制转换
HDOJ 2031 进制转换
98 0