[水题][第一阶段-简单操作][HDOJ-1720]A+B Coming

来源:互联网 发布:留学文书修改 知乎 编辑:程序博客网 时间:2024/06/04 18:25
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 9A Ba b
 


Sample Output
102121


import java.util.Scanner;public class Main {public static void main(String[] args) {// TODO Auto-generated method stubScanner in = new Scanner(System.in);String a,b;while(in.hasNext()){a=in.next();b=in.next();int A=Integer.parseInt(a,16);int B=Integer.parseInt(b,16);System.out.println(A+B);}}}


0 0
原创粉丝点击