A + B Again

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)

Total Submission(s): 15772    Accepted Submission(s): 6847

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
 
Source

1.%I64X 输入

2.%I64X 不能输出负数

3.%I64O 也不能输出负数

4.如果x 为小写 输出的16进制为小写,为大写,输出大写

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#define oo 0x13131313
using namespace std;
int main()
{
long long A;long long B;
while(scanf("%I64O%I64O",&A,&B)!=EOF)
{
long long C=A+B;
// if(C<0)
// printf("-%I64X\n",-C);
printf("%I64o\n",C);
}
return 0;
}

【进制问题】【HDU2056】A + B Again的更多相关文章

  1. SQL Server 进制转换函数

    一.背景 前段时间群里的朋友问了一个问题:“在查询时增加一个递增序列,如:0x00000001,即每一个都是36进位(0—9,A--Z),0x0000000Z后面将是0x00000010,生成一个像下 ...

  2. 【搬砖】安卓入门(2)- Java开发编程基础--进制转换和运算符

    02.01_Java语言基础(常量的概述和使用)(掌握) A:什么是常量 在程序执行的过程中其值不可以发生改变 B:Java中常量的分类 字面值常量 自定义常量(面向对象部分讲) C:字面值常量的分类 ...

  3. TCP进制转换

    /// <summary> /// 将十六进制字符串转化为字节数组 /// </summary> /// <param name="src">& ...

  4. 将十进制数转为一个n位数的密码(每位都是个m进制数)

    例如一个6位数的10进制密码,共有106个密码,如果把每个6位数的密码编成号就是[0,106-1].这是十进制的情况,即6个位,每个位有10种选择.如果要遍历所有密码,需要6重for循环,每个循环10 ...

  5. - >code vs 1475 m进制转十进制

    1475 m进制转十进制  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 白银 Silver 题解  查看运行结果   题目描述 Description 将m进制数n转化成一个 ...

  6. ->code vs 1474 十进制转m进制

    1474 十进制转m进制  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 白银 Silver 题解  查看运行结果   题目描述 Description 将十进制数n转换成m进 ...

  7. C++各种进制的转换

    /* @author:CodingMengmeng @theme:各种进制之间的转换 @time:2017-1-6 21:39:08 @blog:http://www.cnblogs.com/codi ...

  8. pyserial 16进制显示与发送

    pyserial 16进制显示与发送 http://www.centoscn.com/python/2013/0817/1320.html 十六进制显示的实质是把接收到的字符诸葛转换成其对应的ASCI ...

  9. 第26章 java进制操作

    java进制操作 1.二进制 二进制只有0和1,逢二进一 二进制多用在计算机中,来自计算机硬件的开关闭合 2.位运算 分别讲解: 2.1.按位与 & 两位全为1,结果才为1 0&0=0 ...

随机推荐

  1. C++中malloc/free和new/delete 的使用

    malloc/free 的使用要点 函数malloc的原型如下: void * malloc(size_t size); 用malloc申请一块长度为length的整数类型的内存,程序如下: int ...

  2. Android系统进程间通信(IPC)机制Binder中的Client获得Server远程接口过程源代码分析

    文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/6633311 在上一篇文章中,我 们分析了And ...

  3. Swift——(一)为Swift内置类型加入属性

    在看苹果官方的Swift Language的时候,遇到实验:Write an extension for the Double type that add an absoluteValue prope ...

  4. kaggle之识别谷歌街景图片中的字母

    https://github.com/lijingpeng/kaggle/tree/master/competitions/image_recognize 识别谷歌街景图片中的字母 street-vi ...

  5. 细讲encodeURI和encodeURIComponent以及escape的区别与应用

    首先,我们都知道这三个东西都是用来编码的 先来说encodeURI()和encodeURIComponent() 这两个是在转换url时候用来编码解码用的. 有编码就会有解码, 解码就是decodeU ...

  6. Global.asax使用2

    ASP.NET中利用Application和Session统计在线人数.历史访问量 先来简单说一下ASP.NET中的Application和Session 下图是我们非常熟悉的Web应用程序的结构: ...

  7. VS 2003 无法打开Web项目,位于服务器“http:10.45.4.70:8080”上的项目不存在

    解决方法: 用记事本打开*.sln文件更改第2行 改成正确的虚拟目录 出现这种情况往往是从一台机器搬到另一台机器造成的虚拟路径名字不同

  8. netCDF

    NetCDF started in 1989 most used in geoscience community array-oriented self-describing header, desc ...

  9. C++程序中不同变量、函数在内存中内存中的分布情况

    一.一个C++编译的程序占用的内存分为以下几个部分 1.栈区:由编译器自动分配 存放函数的参数值,局部变量的值等,操作方式类似于数据结构中的栈. 2.堆区:一般由程序员分配释放,若程序员不释放,程序结 ...

  10. C++ 语言特性的性能分析

    转载:http://www.cnblogs.com/rollenholt/archive/2012/05/07/2487244.html      大多数开发人员通常都有这个观点,即汇编语言和 C 语 ...