|
A + B AgainTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 15391 Accepted Submission(s): 6713Problem 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
Sample Output
思路:当时写的时候,想的是把16进制转化为10进制,相加后再转化为16进制,感觉比较麻烦 就查了网上的博客,才发现16进制也可以加减,就是不能输出正负好,就设置了一个字符c来
控制正负,注意printf("%x\n",sum);和printf(“%X\n",sum);在这道题上是有区别的;刚开始就把
“X"写成"x",一直提交说答案错误!!!正确代码如下
#include<stdio.h> |
相关文章
- String类的subString(a,b)方法(基于jdk 1.9)
- ChatGLM2-6b的本地部署
- B=2W,奈奎斯特极限定理详解
- A1002 A+B for Polynomials (25)(25 分)
- C++ B (1124) : 斐波那契数列第n项Plus-二、参考代码
- 基于形态学滤波的心电信号ECG处理(MATLAB 2021B)
- 基于广义极大极小凹惩罚的心电信号降噪方法(MATLAB R2021B)
- 通过Excel,生成sql,将A表数据插入B表
- 采用java语言+B/S架构+后端SpringBoot前端Vue开发的ADR药品不良反应智能监测系统源码-主动识别ADR信号: 检验值监测 通过监测患者异常检验值、与药品不良反应相关的特殊检验值发现疑似病例。 住院检验结果文本监测 通过监测住院患者检验结果的文本内容,发现检验结果异常的疑似病例。 抗菌药送检记录 提供院内HIS系统送检判断接口和保存接口,记录抗菌药用药目的。 提供医嘱用药目的展示、送检展示,以及提供筛选。 EMR智能读取 通过读取患者EMR首次病程记录、每日病程记录和出院记录的关键词发现疑似病例。 ADR药物不良反应系统管理
- Llama-2-13b-chat-hf单卡、多卡推理-二.单卡推理