题目链接: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.

Sample Input
+A -A
+1A 12
1A -9
-1A -12
1A -AA
 
Sample Output
0
2C
11
-2C
-90
 #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的更多相关文章

  1. hdu 2057 A+B Again

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2057 题目分析:涉及到16进制内的加法,可以用%I64x直接来处理,要注意到16进制中负数是用补码来表 ...

  2. HDU 2057 十六进制加减法

    http://acm.hdu.edu.cn/showproblem.php?pid=2057   水题,%I64X 长整形十六进制输入输出     #include<stdio.h> in ...

  3. 题解报告:hdu 2057 A + B Again

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2057 问题描述 我们的HDOJ必须有许多A + B问题,现在又有新的问题出现. 给你两个十六进制整数, ...

  4. hdu 2057

      PS:一开始我画蛇添足的用字符串来做....超麻烦...贴个我做的.. 代码: #include "stdio.h" #include "string.h" ...

  5. HDU——PKU题目分类

    HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...

  6. [转] HDU 题目分类

    转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008 ...

  7. HDU ACM 题目分类

    模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 104 ...

  8. HDU 5643 King's Game 打表

    King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...

  9. 转载:hdu 题目分类 (侵删)

    转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...

随机推荐

  1. HDU 4803 Poor Warehouse Keeper

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4803 解题报告:有一个记录器,一共有两个按钮,还有两行屏幕显示,第一行的屏幕显示的是数目,第二行的屏幕 ...

  2. thinkphp加载第三方类库

    http://www.cnblogs.com/jiqing9006/p/5041389.html

  3. 如何将jsp页面的table报表转换到excel报表导出

    假设这就是你的jsp页面: 我们会添加一个“导出到excel”的超链接,它会把页面内容导出到excel文件中.那么这个页面会变成这个样子 在此,强调一下搜索时关键词的重要性,这样一下子可以定位到文章, ...

  4. linux kernel i2c底层代码跟踪

    其实跟上次跟的平台总线有关 在arch/arm/mach-mx6/board-mx6q_sabresd.c 文件中 static void __init mx6_sabresd_board_init( ...

  5. BZOJ 1922: [Sdoi2010]大陆争霸

    Description 一个无向图,到一个点之前需要先到其他点,求从第一个点到第 \(n\) 点最短时间. Sol 拓扑+Dijkstra. 跑Dijkstra的时候加上拓扑序... 用两个数组表示 ...

  6. 我的Vim配置(自动补全/树形文件浏览)

    配置文件的下载路径在这里  http://files.cnblogs.com/files/oloroso/vim.configure.xz.gz 这实际上是一个 xz 格式的文件,添加的 gz 文件后 ...

  7. 【leetcode】Search in Rotated Sorted Array II

    Search in Rotated Sorted Array II Follow up for "Search in Rotated Sorted Array":What if d ...

  8. Unity3d《Shader篇》Logo闪光特效

    Shader "Custom/Flash" { Properties { _MainTex ("Base (RGB)", 2D) = "white&q ...

  9. java web 学习 --第五天(Java三级考试)

    第四天的学习内容:http://www.cnblogs.com/tobecrazy/p/3454860.html Response对象 response对象主要是向客户端浏览器发送二进制数据,如输出C ...

  10. Application.AddMessageFilter(this);

    开发环境:windows 8(x64), vs2013 只要“项目属性-调试”中选中“启用Visual Studio承载进程“,在VS2013中用F5调试,调用Application.AddMessa ...