杭电 OJ 1720 A+B Coming
来源:互联网 发布:建立党建工作网络平台 编辑:程序博客网 时间:2024/05/20 09:09
A+B Coming
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9659 Accepted Submission(s): 6309
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. ^_^
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.
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
///////1
#include<stdio.h>
int
main()
{
int
a,b;
while
(~scanf(
"%x %x"
,&a,&b))
{
printf(
"%d\n"
,a+b);
}
return
0
;
}
///////2
#include <iostream>
using namespacestd;
int main()
{
int a,b;
while(cin>>hex>>a>>b)
{
cout << a+b<<endl;
}
return0;
}
////拓展
cin>>oct>>i; //输入为八进制数 4 cin>>hex>>j; //输入为十六进制数 5 cin>>k; //输入仍为十六进制数 6 cin>>dec>>l; //输入为十进制数 7 cout<<”hex:”<<”i=”<<hex<<i<<endl; 8 cout<<”dec:”<<”j=”<<dec<<j<<′\t′<<”k=”<<k<<endl; 9 cout<<”oct:”<<”l=”<<oct<<l;10 cout<<dec<<endl; //恢复十进制输出状态//本题就是一个十六进制数的加法,上面附带了一些可能用到的输入。
阅读全文
0 0
- 杭电 OJ 1720 A+B Coming
- 杭电OJ-A+B Coming
- 杭电OJ题1720 A+B Coming 解题报告
- 杭电ACM 1720: A+B Coming
- 杭电oj(Java版)——1720 A+B Coming
- 杭电 HDU ACM 1720 A+B Coming
- 杭电 1720 A+B Coming 十六进制转化为十进制
- A+B Coming 1720
- 1720 A+B Coming
- HDU 1720 A+B Coming
- hdu 1720 A+B Coming
- hdu 1720 A+B Coming
- HDU 1720 A+B Coming
- hd 1720 A+B Coming
- HDU 1720 A+B Coming
- HDU 1720 A+B Coming
- hdu 1720 A+B coming
- hdoj-1720-A+B Coming
- Atlassian系列软件破解研究记录
- 常用框架
- IO流学习小结
- 【二分图匹配入门专题1】M
- noip2013货车运输(lca)
- 杭电 OJ 1720 A+B Coming
- EtherCAT State Transition
- lower_bound()返回值
- STM8S105系列单片机管脚复用配置(选项字节的配置)
- 交叉排序
- HDU-Kirinriki
- JavaScript Canvas 绘图
- junit测试、内省、BeanUtils
- 数据中心的女性如何工作的?