A + B Again

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 11855    Accepted Submission(s): 5178

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
 
Author
linle
涉及到进制格式问题:X 表示大写的16进制,x表示小写的16进制;
代码

#include<stdio.h>

int main()
{
_int64 a,b;
while(scanf("%I64X%I64X",&a,&b)==)
{
if(a+b<)
printf("-%I64X\n",-(a+b));
else
printf("%I64X\n",a+b);
}
return ;
}

HDUOJ---A + B Again的更多相关文章

  1. hduoj 1455 && uva 243 E - Sticks

    http://acm.hdu.edu.cn/showproblem.php?pid=1455 http://uva.onlinejudge.org/index.php?option=com_onlin ...

  2. hduoj 4712 Hamming Distance 2013 ACM/ICPC Asia Regional Online —— Warmup

    http://acm.hdu.edu.cn/showproblem.php?pid=4712 Hamming Distance Time Limit: 6000/3000 MS (Java/Other ...

  3. hduoj 4706 Herding 2013 ACM/ICPC Asia Regional Online —— Warmup

    hduoj 4706 Children's Day 2013 ACM/ICPC Asia Regional Online —— Warmup Herding Time Limit: 2000/1000 ...

  4. hdu-oj 1874 畅通工程续

    最短路基础 这个题目hdu-oj 1874可以用来练习最短路的一些算法. Dijkstra 无优化版本 #include<cstdio> #include<iostream> ...

  5. C#版 - HDUoj 5391 - Zball in Tina Town(素数) - 题解

    版权声明: 本文为博主Bravo Yeung(知乎UserName同名)的原创文章,欲转载请先私信获博主允许,转载时请附上网址 http://blog.csdn.net/lzuacm. HDUoj 5 ...

  6. C++版 - HDUoj 2010 3阶的水仙花数 - 牛客网

    版权声明: 本文为博主Bravo Yeung(知乎UserName同名)的原创文章,欲转载请先私信获博主允许,转载时请附上网址 http://blog.csdn.net/lzuacm. C++版 - ...

  7. HDUOJ题目HTML的爬取

    HDUOJ题目HTML的爬取 封装好的exe/app的GitHub地址:https://github.com/Rhythmicc/HDUHTML 按照系统选择即可. 其实没什么难度,先爬下来一个题目的 ...

  8. hduoj 1251 统计难题

    http://acm.hdu.edu.cn/showproblem.php?pid=1251 统计难题 Time Limit: 4000/2000 MS (Java/Others)    Memory ...

  9. hduoj 1286 找新朋友

    http://acm.hdu.edu.cn/showproblem.php?pid=1286 找新朋友 Time Limit: 2000/1000 MS (Java/Others) Memory Li ...

  10. hduoj 1285 确定比赛名次

    http://acm.hdu.edu.cn/showproblem.php?pid=1285 确定比赛名次 Time Limit: 2000/1000 MS (Java/Others) Memory ...

随机推荐

  1. LeetCode: Implement strStr() [027]

    [题目] Implement strStr(). Returns a pointer to the first occurrence of needle in haystack, or null if ...

  2. matlab 投影

    function[l]= Gray(I) % I: The name of image A=imread(I);m=0;n=0;[m,n]= size(A);Hproj=zeros(m,1);Vpro ...

  3. vld,Bounds Checker,memwatch,mtrace,valgrind,debug_new几种内存泄露检测工具的比较,Valgrind Cheatsheet

    概述 内存泄漏(memory leak)指由于疏忽或错误造成程序未能释放已经不再使用的内存的情况,在大型的.复杂的应用程序中,内存泄漏是常见的问题.当以前分配的一片内存不再需要使用或无法访问时,但是却 ...

  4. 在 Sublime Text 2 下开启 Vim 模式

    緣由 由於在 Sublime Text 2 下操作時會想起 Vim 下的鍵盤操作.一時興起在網絡上找了下,發現 Sublime Text 2 是支持類似 Vim 的鍵盤操作的.在此分享下配置過程. 打 ...

  5. Android - 错误:&quot;No resource found that matches the given name android:Theme.Material&quot;

    Android - 错误:"No resource found that matches the given name android:Theme.Material" 本文地址:  ...

  6. VMware与Cisco DRAC中的virtual disk的对应关系

    笔者面临的问题如下: 笔者有一台Cisco C240的服务器, 其中有十块容量一样大的SAS的local disk, 一块SSD. 其中的两块SAS盘组成了一个RAID 1的virtual drive ...

  7. IOS UITableView拖动排序功能

    UITbableView作为列表展示信息,除了展示的功能,有时还会用到删除,排序等功能,下面就来讲解一下如何实现排序. 排序是当表格进入编辑状态后,在单元格的右侧会出现一个按钮,点击按钮,就可以拖动单 ...

  8. 以太网帧、IP报文格式

    这几天完成一个对比以太网帧的程序(c语言),老师给了以太网帧头部和IP报文头部的结构体,跟实际抓取到的数据包的格式是相同的. 以太网帧头部的数据结构: typedef struct { unsigne ...

  9. 关于COM组件log的位置

    进程内组件写的log,如果不指定路径直接提供文件名,log文件的位置在dll所在的目录中. 进程外组件写的log,如果不指定路径直接提供文件名,log文件的位置不在exe所在的目录中,而是在系统目录. ...

  10. springboot h2数据库的配置

    配置文件 #h2 数据库配置 #配置数据库连接地址spring.datasource.url=jdbc:h2:sunniwell:sos#配置数据库驱动spring.datasource.driver ...