A + B Again

  • Problem Description

    There must be many A + B problems in our HDOJ , now a new one is coming.

    Give you two hexadecimal integers , your task is to calculate the sum of them,and print it in hexadecimal too.

    Easy ? AC it !

  • Input

    The input contains several test cases, please process to the end of the file.

    Each case consists of two hexadecimal integers A and B in a line seperated by a blank.

    The length of A and B is less than 15.

  • Output

    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

题意:

给两个16进制的数,计算两数和

代码如下:

#include<stdio.h>

int main(void)
{
__int64 a, b; while(scanf("%I64x%I64X", &a, &b) != EOF)
printf(a+b<0?"-%I64X\n":"%I64X\n", a+b<0?-a-b:a+b);
return 0;
}

hdu 1057 A + B Again的更多相关文章

  1. HDU 1057 What Are You Talking About trie树 简单

    http://acm.hdu.edu.cn/showproblem.php?pid=1075 题意 : 给一个单词表然后给一些单词,要求翻译单词表中有的单词,没有则直接输出原单词. 翻译文段部分get ...

  2. hdu 1057 (simulation, use sentinel to avoid boudary testing, use swap trick to avoid extra copy.) 分类: hdoj 2015-06-19 11:58 25人阅读 评论(0) 收藏

    use sentinel to avoid boudary testing, use swap trick to avoid extra copy. original version #include ...

  3. HDU 1057 - A New Growth Industry

    简单的模拟. 给定天数n,给定D[0]~D[15]给定一个20*20的矩阵.每个格子内有一个0~3的数字,表示细菌数.每天,每个格子将加上D[k],k表示这个格子以及上下左右相邻格子的细菌之和(矩阵外 ...

  4. HDU——PKU题目分类

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

  5. [转] HDU 题目分类

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

  6. HDU ACM 题目分类

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

  7. HDU 5643 King's Game 打表

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

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

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

  9. hdu 分类

    HDU分类 http://www.cnblogs.com/ACMan/archive/2012/05/26/2519550.html#2667329 努力A完.方便自己系统A题 不断更新中...... ...

随机推荐

  1. RepBaseRepeatMaskerEdition下载 | RepeatMasker

    开源的生物信息世界居然有这么个需要注册才能下载的工具,开源世界不是怎么方便怎么来吗? 这个注册真的麻烦,这里上传了一个可以使用的版本. RepBaseRepeatMaskerEdition-20170 ...

  2. WPF:数据和行为

    如果自己来做一个UI框架,我们会首先关注哪些方面?我想UI框架主要处理的一定包括两个主要层次的内容,一个是数据展现,另一个就是数据操作,所以UI框架必须能够接收各种不同的数据并通过UI界面展现出来,然 ...

  3. 20181013xlVba年级成绩报表

    Public Sub 高一成绩报表() Application.ScreenUpdating = False Application.DisplayAlerts = False Application ...

  4. tomcat启动问题,卡在 preparing launch delegate 100% 的解决方法

    今天在打开eclipse中的tomcat时,每次用debug模式启动的时候总是会在preparing launch delegate到100%的时候卡主,起初以为是tomcat启动时间45s不够,于是 ...

  5. Create a Hadoop Build and Development Environment

    Create a Hadoop Build and Development Environment http://vichargrave.com/create-a-hadoop-build-and-d ...

  6. Spring Batch Bean 校验 API 支持

    这个发布版本带来了一个新的  ValidatingItemProcessor 实现,这个实现被称为 BeanValidatingItemProcessor.能够让你使用 Bean Validation ...

  7. linux网络配置命令(一)——ifconfig

    linux网络配置命令(一)——ifconfig ifconfig 查看.配置网卡信息.已过时,推荐使用ip命令 格式:  ifconfig [interface]                   ...

  8. Python基础之文件的基本操作

    概述:文件的基本操作1.open 打开文件 f = open("xxx",mode="r",encoding="utf-8") #常用形式 ...

  9. java之collection总结

    Collection 来源于Java.util包,是非常实用常用的数据结构!!!!!字面意思就是容器.具体的继承实现关系如下图,先整体有个印象,再依次介绍各个部分的方法,注意事项,以及应用场景.   ...

  10. springBoot配置,贴个图

    spring: datasource: name: test url: jdbc:mysql://localhost:3306/epay?characterEncoding=UTF-8 usernam ...