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. 在Spring Boot中使用 @ConfigurationProperties 注解, @EnableConfigurationProperties

    但 Spring Boot 提供了另一种方式 ,能够根据类型校验和管理application中的bean. 这里会介绍如何使用@ConfigurationProperties.继续使用mail做例子. ...

  2. Python 编程快速上手 第十一章 Web scrapping

    前言 这一章讲了如何在 Web 上抓取相关的信息,工具是三个模块: webbrowser 模块:用于打开浏览器指定页面 requests 模块:用于下载文件 Beautiful Soup 模块:用于解 ...

  3. 卡方分布 | t检验 | F检验 | 卡方检验 | 假设检验 | 各种检验持续总结

    Chi-square distribution introduction 这个视频真的好,完美地解释了卡方统计量是怎么来的! 我们有一个标准正态分布的总体,我们从其中抽一次,取该值的平方就是Q1统计量 ...

  4. 质控工具之cutadapt的使用方法

    cutadapt 参考:用cutadapt软件来对双端测序数据去除接头 fastqc可以用于检测,检测出来了怎么办? 看了几篇高水平文章,有不少再用cutadapt,虽然有时候数据真的不错,但是还是要 ...

  5. 2. 搭建DRF项目

    企业项目开发流程 一.需求分析 1.企业的web项目类型: 商城 门户网站[企业站和门户站] 社交网络 资讯论坛 内部系统 个人博客 内容收费站 前端的静态页面制作,外界开发的时候,是照着psd/pn ...

  6. linux常用网络命令ping和arping

    linux常用网络命令ping和arping ping 向目标主机发送icmp请求包 常用来测试当前主机与目标主机网络连接状况 常见选项 -c              设置发包的个数 -s      ...

  7. MySql之行记录的详细操作,创建用户以及库表的授权

    一 介绍 MySQL数据操作: DML ======================================================== 在MySQL管理软件中,可以通过SQL语句中的 ...

  8. 『TensotFlow』RNN中文文本_上

    中文文字预处理流程 文本处理 读取+去除特殊符号 按照字段长度排序 辅助数据结构生成 生成 {字符:出现次数} 字典 生成按出现次数排序好的字符list 生成 {字符:序号} 字典 生成序号list ...

  9. SpringBoot热部署:spring-boot-devtools在Idea中热部署方法

    1 pom.xml文件 注:热部署功能spring-boot-1.3开始有的 <!--添加依赖--> <dependency> <groupId>org.sprin ...

  10. cookie VS localstorage

    http://jerryzou.com/posts/cookie-and-web-storage/ cookie: 1. 数据上限4KB左右 2. 一般由服务器生成,可设置失效时间.如果在浏览器端生成 ...