1058 A+B in Hogwarts (20 分)

对称加密和非对称加密、公钥和私钥、单向认证和双向认证、数字签名、数字证书、根证书 文章目录1. 什么是公钥和私钥?2. 加密算法2.1 对称加密2.2 非对称加密2.2.1 非对称加密的重要性质2.2.2 非对称加密算法应用2.2.2.1 应用1 加密通信2.2.2.1.1 单向认证和双向认证2.2.2.1 应用2 数字签名3. 数字签名3.1 数字签名用法演示3.2 数字签名存在问题4. 数字证书(Digital Certificate)4.1 创建数字证书4.1.1 举例,CA如何给我们签发一个有效证书: 1. 什么是公钥和私钥? 摘自《什么是公钥和私钥?》 公钥(Public Ke 阅读详情

在这里插入图片描述
1058 A+B in Hogwarts (20 分)
If you are a fan of Harry Potter, you would know the world of magic has its own currency system – as Hagrid explained it to Harry, “Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a Sickle, it’s easy enough.” Your job is to write a program to compute A+B where A and B are given in the standard form of Galleon.Sickle.Knut (Galleon is an integer in [0,10
7
], Sickle is an integer in [0, 17), and Knut is an integer in [0, 29)).

Input Specification:
Each input file contains one test case which occupies a line with A and B in the standard form, separated by one space.

Output Specification:
For each test case you should output the sum of A and B in one line, with the same format as the input.

Sample Input:
3.2.1 10.16.27
Sample Output:
14.1.28

#include<iostream>
using namespace std;
struct {
	long Galleon;
	int Sickle;
	int Knut;
}money[3];
int main() {
	long sum;
	scanf("%ld.%d.%d", &money[0].Galleon, &money[0].Sickle, &money[0].Knut);
	scanf("%ld.%d.%d", &money[1].Galleon, &money[1].Sickle, &money[1].Knut);
	sum = (money[0].Galleon + money[1].Galleon) * 493 + (money[0].Sickle + money[1].Sickle) * 29 + (money[0].Knut + money[1].Knut);
	money[2].Galleon = sum / 493;
	money[2].Sickle = (sum - money[2].Galleon * 493) / 29;
	money[2].Knut = sum - money[2].Galleon * 493 - money[2].Sickle * 29;
	cout << money[2].Galleon << "." << money[2].Sickle << "." << money[2].Knut;
	return 0;
}
频谱分析常见坑:STM32的ADC采样+FFT处理时如何避免这5个错误 本文深入剖析了在STM32平台上进行ADC采样与FFT频谱分析时,工程师最常遇到的五个关键错误与性能陷阱。内容涵盖从采样频率设置、频谱泄露处理、ADC配置优化,到谐波识别校准及系统实时性设计,提供了详尽的避坑指南与实战调优策略,旨在帮助开发者构建稳定、精确的嵌入式频谱分析或波形识别系统。 阅读详情

相关推荐

InSAR_ISCE软件数据处理流程之:利用哨兵数据获取2015年尼泊尔地震同震形变场

ISCE软件数据处理流程之:利用哨兵数据获取2015年尼泊尔地震同震形变场 ISCE软件做干涉只需要将数据准备好,并配置好insarApp.xml文件即可进行。 一、数据准备 1、SAR数据获取 本利中使用的数据为欧空局提供的sentinel-1A/B数据,可从阿拉斯加数据服务器上下载,具体下载方法可参考: 哨兵数据下载方法. 2、哨兵卫星轨道文件下载 哨兵数据处理除了需要SAR影像外,还需提供轨道参数文件,可从https://qc.sentinel1.eo.esa.int/aux_poeorb/下载。下载

weixin_42128764的博客 1万+

1058 A+B in Hogwarts (20 分)

1058A+B in Hogwarts(20分) If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver Sickles to a Galleon ...

树叶子的博客 326

图解凸函数与凹函数:别再被数学定义搞晕了!

本文通过图解和生活化类比,深入浅出地解释了凸函数与凹函数的数学定义及其与日常直觉的差异。文章详细介绍了凸函数的图像特征、数学定义(包括二阶导数判断)、在机器学习中的重要性,以及常见误区和实际应用中的判断技巧,帮助读者彻底理解这一关键数学概念。

weixin_29159441的博客 657

1058 A+B in Hogwarts (20 分)

  If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a...

韩江雪de 小屋 584

SpringBoot集成MinIO依赖冲突问题

场景一: 使用minio8.3.0版本的依赖,报下列异常: An attempt was made to call a method that does not exist. The attempt was made from the following location: io.minio.S3Base.<clinit>(S3Base.java:105) The following method did not exist: okhttp3.Requ...

qq_39974348的博客 1万+

S7-200SMART系列全套接线说明

SMART200接线方法,输入,输出,模拟量,面板,扩展糟等,并且详细说明接线原理。

文都龙哥 1万+

1058 A+B in Hogwarts (20 分)

1058 A+B in Hogwarts (20 分) If you are a fan of Harry Potter, you would know the world of magic has its own currency system – as Hagrid explained it to Harry, “Seventeen silver Sickles to a Galleon an...

恒治学 233

电脑版微信多开,最详细教程没有之一

首先桌面任意的位置右键新建文本文档输入如下代码: TASKKILL /F/IM WECHAT.EXE start " " "D:\Program Files (x86)\Tencent\WeChat\WeChat.exe" start " " "D:\Program Files (x86)\Tencent\WeChat\WeChat.exe" ...

大超子 4390

【PAT 甲级】1058 A+B in Hogwarts (20 分)

1058A+B in Hogwarts(20分) If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver Sickles to a Galleon ...

CrystalXueNing的博客 250

SAP-ABAP:SAP基础数据校验工具开发系列博客(共5篇) 第一篇:需求梳理与架构设计:从零搭建SAP主数据校验能力底座

摘要: 本系列博客介绍SAP主数据校验工具的开发和设计,旨在解决物料、供应商、客户等主数据录入不规范、关联缺失和合规性问题。第一篇聚焦需求梳理与架构设计,提出分层技术架构(展示层、业务逻辑层、数据访问层),支持实时校验和批量校验两种模式,并详细说明规则引擎设计、SAP系统对接方案及权限管控逻辑。后续篇章将深入规则引擎实现、接口对接、结果可视化和性能优化,帮助构建集中式、可配置的主数据校验能力,提升SAP数据质量。

baidu_35680696的博客 330

RK3568实现蓝牙音箱功能

A2DP旨在通过蓝牙连接传输高质量的立体声音频流。它使用的基本压缩算法是SBC(Sub-Band Coding)来减小音频数据的大小,同时保持高音质,SBC压缩虽然效率较低,但是是必须支持的基本备用方案。A2DP还支持其他高级编解码器,例如AAC、aptX和LDAC,这些编解码器比SBC提供更好的音质,但这些编解码器的支持取决于设备本身的支持情况。注意A2DP协议要与AVRCP协议区分开。A2DP是传输音频的,而AVRCP是用来控制音频的。这里我用到的是RK3568 Android11。

leikko的博客 1175

1058 A+B in Hogwarts (20分)

题目 If you are a fan of Harry Potter, you would know the world of magic has its own currency system – as Hagrid explained it to Harry, “Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a ...

小白的博客 154

SAM3 几行代码支持任意图像分辨率,减少显存占用(针对transformers库)

几行代码让sam3支持任意图像分辨率

qq_41234663的博客 156

【PAT甲级A1058】A+B in Hogwarts (20分)(c++)

1058 A+B in Hogwarts (20分) 作者:CHEN, Yue 单位:浙江大学 代码长度限制:16 KB 时间限制:400 ms 内存限制:64 MB If you are a fan of Harry Potter, you would know the world of magic has its own currency system – as Hagrid explained it to Harry, “Seventeen silver Sickles to a Galleon an

小庄同学的博客 350

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

[PAT] 1058 A+B in Hogwarts (20 分)Java

If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver Sickles to a Galleon and twenty-nine Knuts to...

Simma1101的博客 229

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

1058 A+B in Hogwarts (20 分)C语言

1058 A+B in Hogwarts (20 分) If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver Sickles to a Galleon ...

还有很长很长的路 214

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

PAT甲级 1058 A+B in Hogwarts (20分)

1058 A+B in Hogwarts (20分) 题目链接:PAT A 1058 题目大意:29个knut可以换1个sickle,17个sickle可以换一个galleon,现在给出两个值都是用galleon.sickle.knut的形式表示且都是按照标准形式输入的,即galleon取值范围[0,10的7次幂],sickle取值[0,17),knut取值[0,29)。要求出这两个值的和并且按...

weixin_43684054的博客 229

A1058 A+B in Hogwarts (20 分)

开始的时候觉得跟B里面的一道题目几乎一模一样 只不过从相减变成了相加;按照同样的方法 发现总是ac不了 然后才考虑到相加会超出int的范围 比较暴力的方法 直接把int全都改成了long long 发现直接ac了,但是比较正规的解法应该是方法二。 方法一: #include&lt;cstdio&gt; int main() { long long sum1, sum2,sum; long lo...

A_Aria的博客 269

PAT-A 1058 A+B in Hogwarts (20 分)

思路:使用scanf("%d.%d.%d", &galleon, &sickle, &knut)的格式读入数据。

qq_38127801的博客 151

PAT A1058 A+B in Hogwarts (20分)

题目链接:https://pintia.cn/problem-sets/994805342720868352/problems/994805416519647232 题目描述 If you are a fan of Harry Potter, you would know the world of magic has its own currency system – as Hagrid expl...

Rhao的博客 178

1058 A+B in Hogwarts (20 分)

1058A+B in Hogwarts(20 分) If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver Sickles to a Ga...

weixin_30886233的博客 63
上一篇: 1027 Colors in Mars (20 分)
下一篇: 1006 换个格式输出整数 (15 分)
好想当依蕾娜小姐的狗
博客等级 码龄7年 0粉丝 62原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值