[PAT甲级]1005. Spell It Right (20)(求数字各个位上的和,英文输出)

【技术纵览】行为识别前沿模型演进:从CNN到多模态大模型 本文全面解析了行为识别技术从CNN到多模态大模型的演进历程,重点介绍了SlowFast、TimeSformer、VideoMAE和InternVideo等SOTA模型的核心创新与应用实践。通过对比分析各代模型在Kinetics-400等数据集上的表现,揭示了自监督学习和多模态融合如何推动行为识别准确率突破85%,并探讨了工业部署中的技术选型策略与优化方向。 阅读详情

1005. Spell It Right (20)

原题链接

Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.

Input Specification:

Each input file contains one test case. Each case occupies one line which contains an N (<= 10100).

Output Specification:

For each test case, output in one line the digits of the sum in English words. There must be one space between two consecutive words, but no extra space at the end of a line.

Sample Input:

12345

Sample Output:

one five

题目大意:

  • 输入一个数N(小于10的100次方),计算N各个位上的数字和sum
  • 将sum用英文输出,两个英文单词中间用空格隔开,最后一位不要有多余空格

思路:

  • 直接输入用字符串表示,遍历字符串,求出各个字符的和,最终输出

代码:

#include <iostream>
#include <string>
using namespace std;

int main()
{
    string v[10] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
    string s;
    getline(cin, s);
    int sum = 0;
    for(int i=0; i<s.size(); i++){
        sum += s[i]-'0';
    }
    string res = "";
    while(sum >= 10){
        res = " " + v[sum%10] + res;
        sum /= 10;
    }
    if(sum < 10)
        res = v[sum] + res;
    cout << res << endl;
    return 0;
}
Challenge 4 - OSCP A 在c盘下发现一个windows.old,在里面可以找到SYSTEM和SAM文件,下载到本地,利用samdump2解密发现没解出来,再来试试pwdump.py(https://github.com/CiscoCXSecurity/creddump7)得到压缩包密码bludecode,解压之后发现一个比较特殊的文件configuration.php,里面有两个类似密码的字符串。登录之后在/opt/backups/下发现几个特殊文件,其中sitebackup3.zip是个正常的压缩包。但是这个压缩包是有密码的。 阅读详情

相关推荐

静态与动态LACP链路聚合:原理、配置与排错实战指南

链路聚合技术是提升网络带宽与可靠性的核心方案,通过将多个物理端口逻辑捆绑,实现带宽叠加与链路冗余。其原理基于IEEE 802.3ad标准,通过负载均衡算法将数据流分布到不同物理链路,既避免了数据包乱序,又提升了整体吞吐量。该技术的核心价值在于消除单端口瓶颈、提供毫秒级故障切换,并能简化网络拓扑管理。在企业服务器接入、数据中心互联及虚拟化平台等场景中,链路聚合已成为构建高可用网络的基础。实践中,动态LACP模式通过协议报文协商,能主动检测链路故障并防止配置错误导致的网络环路,相比静态聚合更为可靠。本文将深入解

weixin_31412781的博客 268

PAT - 甲级 - 1005. Spell It Right (20)

Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: Each input file contains one test case.

i逆天耗子 2902

从零到一:YOLOv11高帧率模型在RDK X5上的ONNX转换与部署实战

本文详细介绍了将最新的YOLOv11高帧率模型部署到地平线RDK X5开发板的完整实战流程。内容涵盖从PyTorch模型导出ONNX、地平线工具链环境配置与模型量化编译,到编写高效的板端推理代码,并针对高帧率目标进行了后处理优化。通过实战避坑指南,帮助开发者在RDK X5上实现30FPS以上的实时目标检测。

weixin_29089057的博客 140

1005. Spell It Right (20)

Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: Each input file contains one test case. Eac

zhangpiu的专栏 391

高温环境下RS485通信故障分析与MOS管解决方案

RS485通信作为工业控制领域的基础总线技术,其可靠性直接影响系统稳定性。在高温等恶劣环境下,传统三极管开关电路会因温度特性导致通信故障。通过分析三极管Ube电压随温度变化的特性,揭示了电路失效的物理原理。相比之下,MOS管作为电压控制型器件,具有温度稳定性好、功耗低等优势,更适合工业环境应用。本文通过一个发动机舱内RS485通信故障的实际案例,详细对比了三极管与MOS管在高温环境下的性能差异,并给出了具体的电路改进方案。该案例对工业通信接口设计具有普遍参考价值,特别适用于需要应对高温、振动等挑战性环境的硬

weixin_42612405的博客 406

深入解析STM32官方库:.c/.h文件功能与应用场景

本文深入解析了STM32官方库中.c和.h文件的核心功能与应用场景。详细剖析了stm32f10x.h、启动文件、外设驱动文件等关键组件的作用,并通过LED闪烁实战演示了如何构建工程、配置文件和调用库函数。文章旨在帮助开发者理解官方库的架构,掌握高效使用技巧,从而降低STM32开发门槛,提升开发效率与代码质量。

weixin_29189377的博客 358

1005 Spell It Right (20 分)(字符串处理,简单题)

1005 Spell It Right (20 分)(字符串处理,简单题) Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: Each in...

virgilshi的博客 705

基于STM32F407的立创球形六足双形态机器人:从Morphex复刻到毕业设计的完整开发指南

本文详细介绍了基于STM32F407主控芯片,从零开始复刻Morphex球形六足双形态机器人的完整开发过程。内容涵盖硬件选型(如总线舵机)、机械结构设计(阿基米德螺旋底盘)、软件控制(逆运动学与步态算法)以及多控制方式集成,为嵌入式系统与机器人开发的毕业设计或爱好者提供了全面的实战指南。

weixin_35414260的博客 322

PAT_A 1005. Spell It Right (20)

1005. Spell It Right (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given a non-negative integer N, your task i

todoooooo的博客 261

XGBoost的简单安装及入门使用

XGBoost安装及简单入门 XGBoost支持多种操作系统,如Windows, Linux, MacOS等,并支持多种语言版本,如Python, R, Scale, Java等。XGBoost的安装方式一般有两种,一种是直接通过pip安装(适合用于Python),另外一种是通过源码编译安装 1、通过pip安装 通过pip安装Python包既简单又方便,只需执行如下的命令: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple xgboost 使用

qq_41513230的博客 3万+

操作系统期末大题类型题解

额,OS主要这回考程序分析题,PV操作、生产者消费者啊,哲学家进餐问题,死锁问题啊,如何避免死锁,经典银行家算法,页面置换算法啥的,磁盘调度......总计还有很多,就不一一说了 PV操作 谈到PV操作,首先要了解什么是信号量,其实就是用来解决互斥与同步问题的,分为原语wait(S)和signal(S),也就是我们常说的PV操作,在这里给出王道上的概念 wait(S){ while(S>0) S=S-1; } signal(S){ S=S+1; } 记录型信号量

ZXxxiaoxuan的博客 795

PAT练习题(甲级) 1005 Spell It Right (20分)(Java实现)

PAT 1005 Spell It Right (20分)题目题意解题思路代码实现 题目 Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: ...

CoderHqf的博客 9557

AEJoy —— 最受欢迎的 5 个 Ae 表达方式

NOTE] 原文作者我意识到表达式可能令人生畏,有些人宁愿复制粘贴有用的代码,而不愿学习这门语言。对此我完全理解。因此,我想与您分享我的。这些是我几乎在每个项目中都会使用的表达式,我认为它们极大地提升了工作流程。

ShaderJoy 的兴趣技术杂货铺 365

PAT甲级 1005 Spell It Right

PAT甲级 1005 Spell It Right Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: Each input file con...

旺崽的博客 2907

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

PAT 甲级题目讲解:1005《Spell It Right》

本文讲解 PAT 甲级 1005 题《Spell It Right》的完整解题思路与 C++ 实现。题目要求对最多 100 位的非负整数求数位和,并将和的每一位以英文单词输出。文章分三步展开:字符串读取与特判、数位求和、数字拆解与英文映射输出,并附完整代码、常见错误提醒及复杂度分析,适合备考 PAT 甲级的读者参考。

qq_35624947的博客 457

VC中sqlite的使用

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

【PAT甲级 - C++题解】1005 Spell It Right

📣专栏定位:为想考甲级PAT的小伙伴整理常考算法题解,祝大家都能取得满分!

Newin2020的博客 726

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

「PAT甲级真题解析」Advanced Level 1005 Spell It Right

题设明确要求我们将给定的一个非负数的各个数字相加求和, 然后输出这个和各个数字的英文形式, 妥妥的模拟题, 而且步骤已经非常明确。 需要考虑的是给定的非负数最大可以是10^100(101位, 1个一后面跟了100个零), 所以需要用字符串来存储整数.

过美好生活,做高效程序员 5223

【PAT甲级】题解-1005 Spell It Right

知识点:字符数粗、字符串、格式化输出、循环

用编程认知世界,Just coding.... 747

【PAT甲级】1005 Spell It Right (20 分)

Spell It Right 题目描述 Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: Each input file contains ...

初见还是重逢的博客 280

PAT 甲级 1005(Spell It Right)

PAT 甲级 1005题目要求翻译代码思路 题目要求 Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: Each input file co...

qq_42865772的博客 257

PAT 甲级 1005  Spell It Right

1005 Spell It Right (20 point(s)) Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: Each inp...

漫浸天空的雨色的备忘录~ 853

1005. Spell It Right (20)-PAT甲级真题

Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input file contains one test case. Each ca...

柳婼 の blog 2737

PAT(甲级) 1005 Spell It Right (20分)

题目来源:PAT(甲级) 1005 Spell It Right (20分) 题目描述: Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: ...

sinat_41835935的博客 166

PAT甲级-1005 Spell It Right (20分)

点击链接PAT甲级-AC全解汇总 题目: Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: Each input file contains...

卷子的博客 505

PAT甲级 - 1005 Spell It Right (20 分)

题目链接:PAT甲级 - 1005 Spell It Right (20 分) Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: Ea...

450

[PAT 甲级] 1005 Spell It Right (20 分)

1005 Spell It Right (20 分) Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: Each input file co...

cp0328的博客 3332
上一篇: [PAT乙级]自测3
下一篇: [PAT甲级]1006. Sign In and Sign Out (25)(找出机房开门锁门的人)
whl_program
博客等级 码龄11年 101粉丝 279原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值