hdu 2057 A+B Again
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2057
题目分析:涉及到16进制内的加法,可以用%I64x直接来处理,要注意到16进制中负数是用补码来表示的。一个比较困惑的事实是,这道题再输出时,%64X中‘X’必须是大写,小写是过不了的。
#include <cstdio>
int main()
{
__int64 a, b, c;
while(~scanf("%I64x%I64x", &a, &b)){
c = a+b;
if(c >= ) printf("%I64X\n", c);
else printf("-%I64X\n", -c);
}
return ;
}
hdu 2057 A+B Again的更多相关文章
- 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 h ...
- 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. ...
随机推荐
- Don't Starve,好脚本,好欢乐
最近玩了shank系列的开发公司新出的游戏饥荒(Don't Starve),容量很小,200MB左右,所以可以归类为小游戏..但是游戏性却是相当的高,游戏中各物件的交互出奇的丰富和复杂,我相信该游戏9 ...
- 基于EasyUI实现windows桌面
之前为大家介绍了 基于jquery tool实现的windows桌面效果,今天给大家带来一款基于EasyUI实现windows桌面.这款桌面适用浏览器:360.FireFox.Chrome.Safar ...
- 如何在Fedora或CentOS上使用Samba共享
如今,无论在家里或者是办公场所,不同的电脑之间共享文件夹已不是什么新鲜事了.在这种趋势下,现代操作系统通过网络文件系统的方式使得电脑间数据的交换变得简单而透明.如果您工作的环境中既有微软的Window ...
- The LMAX disruptor Architecture--转载
原文地址: LMAX is a new retail financial trading platform. As a result it has to process many trades wit ...
- Preventing CSRF in Java web apps---reference
reference from:http://ricardozuasti.com/2012/preventing-csrf-in-java-web-apps/ Cross-site request fo ...
- Java再学习——深究static关键字
一.static关键字的用途 可以在没有创建对象的情况下来进行(方法/变量)调用.也就是,被static关键字修饰的方法或者变量不需要依赖于对象来进行访问,只要类被加载了,就可以通过类名去进行访问. ...
- LeetCode45 Jump Game II
题目: Given an array of non-negative integers, you are initially positioned at the first index of the ...
- C#实现Dll(OCX)控件自动注册的两种方法
尽管MS为我们提供了丰富的.net framework库,我们的程序C#开发带来了极大的便利,但是有时候,一些特定功能的控件库还是需要由第三方提供或是自己编写.当需要用到Dll引用的时候,我们通常会通 ...
- C#实现万年历(农历、节气、节日、星座、属相、生肖、闰年等)
C# 万年历 农历 节气 节日 星座 星宿 属相 生肖 闰年月 时辰等,代码如下: using System.Collections.Generic; using System.Text; using ...
- Quadtrees--四叉树
Description A quadtree is a representation format used to encode images. The fundamental idea behind ...