hdu_problem_2057_A + B Again

A + B Again 杭电oj 2056 十六进制 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 t 阅读详情

题目大意:输入两个16进制数,输出相加的结果

/*
*
*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
*校庆杯Warm Up
*
*
*Recommend
*linle
*
*/
#include<iostream>
#include<cmath>
#include<string>
using namespace std;
long long a, b;
int length;
long long htod(string s) {
 long long temp(0);
 length = s.size();
 for (int i = s.size() - 1; i >= 0; --i) {
  if ('A' <= s.at(i) && s.at(i) <= 'Z') {
   temp += (s.at(i) - 'A' + 10)*pow(16, length - i - 1);
  }
  else if (s.at(i) == '-') {
   temp = -temp;
  }
  else if (s.at(i) == '+') {
   continue;
  }
  else {
   temp += (s.at(i) - '0')*pow(16, length - i - 1);
  }
 }
 return temp;
}
int main() {
 string A, B;
 while (cin >> A >> B) {
  a = htod(A);
  b = htod(B);
  if (a + b >= 0)
   printf("%llX\n", a + b);
  else
   printf("-%llX\n",-(a + b));
 }
 system("pause");
 return 0;
}
安卓中蓝牙免提HFP的一些分析 最近看了一些大牛的博客,无不提到了技术分享的重要性,的确,分享自己的知识不仅仅是与他人讨论并相互提高的过程,更是对自己知识的梳理。希望自己能以此为契机,形成周期性博客分享的习惯。 文章标题为HFP的一些分析,HFP(Hand Free Profile)主要定义了安卓中与接打电话相关的一些功能的实现。本文主要介绍这其中对于HFP非常重要的Service Level Connection的建立。首先... 阅读详情

相关推荐

高效数据迁移:ICCAP到ADS的数据导入与导出实战指南

本文提供了从ICCAP到ADS进行高效、准确数据迁移的实战指南。针对射频与微波电路设计中的关键挑战,详细阐述了迁移前的战略规划、ICCAP数据的精细化导出(包括脚本化批处理)、ADS数据的多种导入方法(如Data Items、DML模型库及编程化API),并强调了数据完整性与准确性验证的重要性,确保模型参数和仿真结果在平台间可靠传递。

weixin_29291185的博客 172

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...

qq_43118572的博客 594

嵌入式开发避坑指南:手把手教你用STM32CubeMX配置W9825G6KH SDRAM(含时序参数详解)

本文详细介绍了如何使用STM32CubeMX配置W9825G6KH SDRAM,包括硬件连接检查、CubeMX初始化步骤、时序参数优化及稳定性问题排查。通过实测波形分析和案例分享,帮助开发者避免常见配置错误,提升嵌入式系统性能与稳定性。

weixin_42542669的博客 201

HDOJ 2057 A + B Again(水题,基础)

http://acm.hdu.edu.cn/showproblem.php?pid=2057 A + B Again Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 23442    Accepted Submission(

Shyazhut 725

仪表数字图像识别的传统方法

虽然现有很多机器学习算法能够准确地识别数字,但是传统方法对于一些需要离线识别且计算能力有限的下位机设备来说,仍然有非常不错的效果。因此,今天就向大家讲解一下传统的数字识别方法在仪表读数方面的应用。 1.图像预处理技术 1.1 主要流程 图像处理依次需要进行图片预处理、字轮区域定位、字符分割和字符识别等过程。其中图像处理流程如下图所示。 2. 详细过程 2.1 灰度化 为了减小图像原始数据量,本系...

XYZ 4526

YOLO11创新改进系列:卷积,主干 注意力,C3k2融合,检测头等创新机制(已更新110+)

本专栏提供详细的 YOLO11 教程,包括基础知识、源码解析、入门实践、算法改进和项目实战,适合发表YOLO11 学习者订阅。内容包含 100+多篇独家改进机制,适合发表论文,评分高达 96 分。订阅者将获得一键运行的改进文件及答疑交流群支持。 使用服务器的同学还可以私聊获取搭建好的运行环境。

专注于图像领域,主要研究内容包括计算机视觉和深度学习,特别是在图像分类、目标检测和图像生成等方面有深入的研究和实践经验。 1万+

HDOJ 2057 A + B Again

 A + B Again Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 19352    Accepted Submission(s): 8358 Problem Description There must

Chunzhen的博客 791

【YOLOv8科研级优化】集成YOLOv10的SCDown采样模块,让你的模型下采样更高效更精准

打开确保模型解析器能识别SCDown模块。通过将YOLOv10的SCDown模块集成到YOLOv8中,我们实现了一个“细节保留+高效下采样”的目标检测模型。这个改进不仅在工程上能提升小目标、细粒度场景的检测效果,更在科研上提供了“分阶段下采样”的创新思路——这种思路可以延伸到其他卷积网络(如ResNet、MobileNet)的下采样层改进中,帮你在论文中打造独特的研究点。

m0_71589036的博客 139

第四次—C - A + B Again

C - A + B Again 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 cas

C i C i 253

手把手教你学SOME/IP「3.2.1.发布/订阅行为」

本文详细介绍了SOME/IP协议中的服务发现机制,重点解析了发布/订阅行为的流程。主要内容包括:1)服务发布与Method通信流程,涵盖find/offer报文交互、TTL保活机制及异常处理;2)服务订阅与Event通信流程,包括subscribe/ack报文交互和组播延迟机制;3)特殊场景如快速发送、半周期回复、重置订阅等机制。通过邮局订阅报纸的类比,帮助理解服务发现的核心原理,并强调流程图对于问题定位的重要性。文章为SOME/IP协议的工程实现提供了实用指导。

nihaoljq2010的博客 1231

拉曼光谱入门:5.表面增强与共振增强

拉曼散射效应因其弱信号特性限制了传统拉曼光谱术的检测灵敏度。为克服这一局限,表面增强拉曼光谱术(SERS)和共振增强拉曼光谱术(RRS)被开发出来,显著提升了信号强度。SERS通过金属表面的电磁和化学效应放大信号,而RRS则通过匹配激发光波长与分子电子跃迁波长来增强信号。这两种技术扩大了拉曼光谱的应用范围,尤其在低浓度和微量试样分析中表现出色,尽管在实验操作和试样损伤方面存在挑战。

qq_53529450的博客 1450

HDOJ2057_A + B Again

链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=2057 /*public long nextLong(int radix)将输入的下一个标记扫描为long 。 * 如果下一个令牌不能转换为有效的长值,则此方法将抛出InputMismatchException , * 如下所述。 如果翻译成功,扫描仪将超过匹配的输入。 *

BarryLee的博客 334

工商银行数据智能架构实践

工商银行大数据平台技术创新与实践摘要(149字): 工商银行构建了企业级大数据云基础设施,形成包含批量计算、流计算、联机分析等核心能力的技术架构。平台创新性地实现流批一体处理,将个人储蓄存款监测时效提升至分钟级;通过实时数仓技术将报送时效缩短至1-5分钟;融合内外部数据构建风控模型,债券违约预警准确率达100%。平台还支撑了"码上赢"精准营销和空间数据服务等创新应用,未来将向存算分离、实时数仓和云数智融合方向演进,持续提升数据价值转化能力。

银行信息系统应用架构详解 546

A + B Again 2周练3

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 t...

Zoran的博客 174

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

HDU 2055 An easy problem

3

Shyazhut 308

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

HDU 6319 Problem A. Ascending Rating(单调队列详解)

题目链接 Problem A. Ascending Rating Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 2057Accepted Submission(s): 622 Problem Descriptio...

咸鱼有梦想 288

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

HDU 6319 Problem A. Ascending Rating (单调队列+经验细节)

Problem A. Ascending Rating Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 2057    Accepted Submission(s): 622   Problem De...

满月照亮的路 284

杭电ACM基础题(2048、2049、2053、2055、2056、2057、2060、2061、2071、2073)

文章目录2048、抽奖活动无人中奖的概率[错排问题]2049、不容易系列之(4)——考新郎[错排问题]2053、Switch Game[开关灯]2055、An easy problem[计算n+f(c)]2056、Rectangles[计算重叠部分矩形面积] 2048、抽奖活动无人中奖的概率[错排问题] HDU 2006’10 ACM contest的颁奖晚会隆重开始了! 为了活跃气氛,组织者举行...

柠檬超级酸 5025

A + B Again

A + B Again 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.  E...

Move on 305

hdu 2057 A + B Again

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 i...

迷路的博客 213

hdu2057题解

hdu2057 :A+B again(基础的进制处理) 题目: 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

weixin_53075909的博客 388

HDU1867:A + B for you again

Problem Description Generally speaking, there are a lot of problems about strings processing. Now you encounter another such problem. If you get two strings, such as “asdf” and “sdfg”, the result of

ACM!荣耀之路! 2382

hdu A + B for you again

A + B for you again Time Limit : 5000/1000ms (Java/Other)Memory Limit : 32768/32768K (Java/Other) Total Submission(s) : 3Accepted Submission(s) : 1 Problem Description Generally speaking, th...

weixin_30633405的博客 190

D - A + B for you again

Generally speaking, there are a lot of problems about strings processing. Now you encounter another such problem. If you get two strings, such as “asdf” and “sdfg”, the result of the addition between

ACM77的博客 903

HDU 2057 A + B Again

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2057 A + B Again Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 16518    Accepted Submissi

哇哈哈的专栏 469

【KMP】hdu1867(A + B for you again) 杭电java a题真坑

点击打开链接 Problem Description Generally speaking, there are a lot of problems about strings processing. Now you encounter another such problem. If you get two strings, such as “asdf” and “sdfg”, the

寻找、发现、追求、获得———这就是狼的生活要素 1016
上一篇: hdu_problem_2056_ Rectangles
下一篇: hdu_problem_2058_The sum problem
CoderZhuuu
博客等级 码龄10年 26粉丝 107原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值