首页 > ACM题库 > HDU-杭电 > HDU 1720 A+B Coming[解题报告] C++
2013
12-21

HDU 1720 A+B Coming[解题报告] C++

A+B Coming

问题描述 :

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 may contain multiple test cases. Each case contains A and B in one line.
A, B are hexadecimal number.
Input terminates by EOF.

输出:

Output A+B in decimal number in one line.

样例输入:

1 9
A B
a b

样例输出:

10
21
21

点击打开链接

ps:输入16进制的方法
#include"stdio.h"
	   int main()
   {
	   int a,b;
	   while(scanf("%x%x",&a,&b)!=EOF)
		   printf("%d\n",a+b);
	   return 0;
   }

解题报告转自:http://blog.csdn.net/yangyafeiac/article/details/7828552