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;
}
Ubuntu 22.04 安装 IsaacLab 2.1.0 本文介绍了IsaacLab的完整安装流程:1)创建Python3.10虚拟环境;2)安装PyTorch2.5.1(CUDA11.8);3)升级pip并安装IsaacSim4.5.0;4)克隆IsaacLab仓库;5)运行安装脚本(需接受EULA)。若遇cmake缺失错误,需执行sudo apt安装。安装完成后可通过Ant-v0训练任务验证,成功运行后将显示IsaacSim窗口和训练完成提示。注意:IsaacSim不同版本可共存于不同环境。 阅读详情

相关推荐

实测对比:同步 vs 异步 DCDC,轻载时哪个更‘吵’?效率差多少?(以MP1601为例)

本文通过实测对比MP1601同步与异步DCDC在轻载工况下的噪声与效率表现,揭示异步整流在轻载时产生高频振铃的问题,而同步整流则提供更稳定的波形。测试数据显示,轻载下异步方案效率略高,但同步方案在EMI性能上优势明显,为工程选型提供重要参考。

weixin_30904593的博客 314

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的博客 595

用于可靠的钙钛矿薄膜瞬时光致发光模拟的拟合程序

简介 对光激发后的电荷载流子动态的研究对于确定太阳能电池的几个特性至关重要,例如,体和界面重组的数量以及向电荷传输层转移过程的速度。 瞬态光致发光(trPL)是用于研究这些特性的最流行的表征方法之一。 该实验是通过在样品上照射几纳秒的激光脉冲,并记录一段时间内的发光情况来进行的。辐射性重组的光生电荷载流子将引起太阳能电池的光子发射,而非辐射性重组的电荷载流子将不会对发光作出贡献。因此,可以测量到强度随时间递减的光致发光瞬态。(见图1表示trPL的测量和它的输出)。 图1. 一...

FluximAG的博客 2374

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

[全解] 刷机, BL 锁, Bootloader, Recovery, Magisk, Root, ADB, 线刷, 卡刷, 9008, 绕过 FRP

刷机, BL 锁, Bootloader, Recovery, Magisk, Root, ADB, 线刷, 卡刷, 9008, 绕过 FRP 全解

诺尔的博客 3万+

别只聊天了!手把手教你为Ollama+Open WebUI搭建本地知识库(基于BGE-M3和Qwen)

本文详细介绍了如何利用Ollama、Open WebUI和BGE-M3构建本地知识库,实现智能问答和文档检索。通过环境准备、文档处理、向量化实战和应用案例,帮助用户突破基础聊天场景,打造高效的个人知识管理体系。特别适合技术文档管理和学术研究场景。

weixin_42523720的博客 487

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

CRMEB小程序订阅消息实战指南:PHP配置与疑难排查

本文提供CRMEB小程序订阅消息的完整实战指南,重点解析PHP环境下的配置流程与常见错误解决方法。文章从订阅消息的核心规则讲起,详细拆解了从微信后台获取模板到CRMEB后台完成字段映射的关键步骤,并提供了从用户授权、缓存清除到服务器日志检查的逐层排查方案,帮助开发者高效打通消息通道,避免常见配置陷阱。

weixin_29022115的博客 323

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

嵌入式模拟电路面试题大全及参考答案(持续更新)

高输入阻抗:由于晶体管的基极-发射极(BJT)或栅极-源极(MOSFET)电压很低,跨导放大器具有很高的输入阻抗。低输出阻抗:晶体管的集电极-发射极或漏极-源极电阻较低,提供较低的输出阻抗。电压控制:输入信号控制晶体管的跨导,从而控制输出电流。晶体管:作为放大器的核心,可以是BJT或MOSFET。偏置电路:为晶体管提供稳定的工作点,确保其在放大区域内工作。负载电阻:与晶体管的集电极或漏极连接,将电流转换为电压。晶体管的选择:根据所需的增益、速度和功率消耗选择合适的晶体管。偏置稳定性。

大模型大数据攻城狮的专栏 995

【代码审计】专栏文章汇总

代码审计基础 代码审计基础 源代码审计思路(上) 源代码审计思路(下) 常见漏洞审计 认证会话管理(上) 认证会话管理(下) 输入输出验证 授权管理审计 业务安全审计 第三方组件审计

武天旭的博客 4851

HDOJ2057_A + B Again

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

BarryLee的博客 334

深度学习在移动开发中的应用:实时姿态估计实战

我们将使用TensorFlow Lite框架,结合专为移动端优化的MoveNet模型,实现一个能够在主流Android设备上达到30FPS的多人姿态跟踪解决方案,并深入探讨其优化技巧和实际应用场景。特别是3D姿态估计、多人长期跟踪等前沿技术的发展,将进一步推动移动端姿态估计技术的应用深度和广度。在下一篇文章中,我们将探讨深度学习在移动端的另一个创新应用:实时手势识别,包括如何在资源受限的环境中实现复杂手势的实时识别,以及这项技术在AR/VR交互、智能家居控制等场景中的应用。第四部分:典型应用场景实现。

Programming Talk 331

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的博客 175

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

HDU 2055 An easy problem

3

Shyazhut 308

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

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

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

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

满月照亮的路 285

杭电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

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

第四次—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

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

HDU 2057 A + B Again

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

Infino_coder 465

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

HDU2057 A + B Again【水题】

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

海岛Blog 4291

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

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_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、付费专栏及课程。

余额充值
⌂ 换网址