hdu 2057 A+B
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2057
For each test case,print the sum of A and B in hexadecimal in one line.
#include <cstdio>
#include <iostream>
#include<algorithm>
#include<math.h>
#include <string.h>
#include<queue>
using namespace std; int main()
{
__int64 a,b;
while(scanf("%I64X %I64X",&a,&b)!=EOF)
{
a+=b;
if(a<)
{
a=-a;
printf("-%I64X\n",a);
}
else
printf("%I64X\n",a);//由于%I64X,不能输出
//负数,所以负数的输出要做处理,注意要用 X
}
return ;
}
hdu 2057 A+B的更多相关文章
- hdu 2057 A+B Again
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2057 题目分析:涉及到16进制内的加法,可以用%I64x直接来处理,要注意到16进制中负数是用补码来表 ...
- HDU 2057 十六进制加减法
http://acm.hdu.edu.cn/showproblem.php?pid=2057 水题,%I64X 长整形十六进制输入输出 #include<stdio.h> in ...
- 题解报告:hdu 2057 A + B Again
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2057 问题描述 我们的HDOJ必须有许多A + B问题,现在又有新的问题出现. 给你两个十六进制整数, ...
- hdu 2057
PS:一开始我画蛇添足的用字符串来做....超麻烦...贴个我做的.. 代码: #include "stdio.h" #include "string.h" ...
- HDU——PKU题目分类
HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...
- [转] HDU 题目分类
转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008 ...
- HDU ACM 题目分类
模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 104 ...
- HDU 5643 King's Game 打表
King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...
- 转载:hdu 题目分类 (侵删)
转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...
随机推荐
- unity 2d 和 NGUI layer
http://blog.csdn.net/xtxy/article/details/37876825 在使用unity2d开发游戏的时候,使用了NGUI作为界面,本来二者配合得还挺好,但是一个使用场景 ...
- css 3d 动画 相关
transform-style: preserve-3d; 设置3D模式 perspective:700px :属性定义 3D 元素距视图的距离,以像素计.该属性允许您改变 3D 元素查看 3D 元素 ...
- iOS 开发笔记 -- 各种细枝末节的知识(水滴石穿)
在此总结整理,遇到的各种的小问题: 1.通过从字典(数组)中取出的NSString的length==0 作为if的判断条件导致的carsh: 由于在字典中通过Key取出值之后直接做了length相关操 ...
- caffe学习系列(3):数据层介绍
一个模型由多个层构成,如Data,conv,pool等.其中数据层是模型的最底层,是模型的入口. 提供数据的输入,也提供数据从Blobs转换成别的格式进行保存输出还包括数据的预处理(如减去 均值, 放 ...
- memcache 与 mencached扩展的区别
memcache是一套分布式的高速缓存系统,由LiveJournal的Brad Fitzpatrick开发,但目前被许多网站使用以提升网站的访问速度,尤其对于一些大型的.需要频繁访问数据库的网站访问速 ...
- django xadmin多个model的数据渲染在统一个template中
adminx.py demo class ModelAdmin(object): #.... def get_context(self): context = super(SimCardService ...
- python md5加密中文
import md5 md5.new(u'中文').hexdigest() 会失败,报告ascii码不能解码0x.... 原因是md5会自动将被加密的数据转成字节码,如果没有详细制定编码,则可能采用了 ...
- 【转】【编码】ASCII 、UNICODE和UTF-8之二
字符发展 1. 美国 ASCII-(American standard code information interchange) 美国信息互换标准代码 范围:1-127 ; 单字 备注:前部用作控制 ...
- mysql “group by ”与"order by"的研究--分类中最新的内容
这两天让一个数据查询难了.主要是对group by 理解的不够深入.才出现这样的情况这种需求,我想很多人都遇到过.下面是我模拟我的内容表我现在需要取出每个分类中最新的内容 select * from ...
- HTTP Servlet 重要的几个方法
HTTP Servlet继承了GencenServlet类 GencenServlet实现了两个接口··一个用于ServletConfig设置接口,一个为Servlet接口只要是(1) init ...