Digital Roots HDU - 1013

AD(Altium Designer)器件封装——立创商城导出原理图和PCB完成器件封装操作指南 官网:www.SZLCSC.COM以芯片为例器件类——>芯片类——>对应芯片确定芯片——>数据手册1:原理图2:PCB3:打开操作流程选中原理图——>文件——>导出——>AD1: ✔2:导出AD文件操作流程选中PCB图——>文件——>导出——>AD1: ✔2:导出AD文件1:PCB图2:原理图操作流程文件——>打开操作流程选中文件——>打开操作流程项目文件——>添加新的...到工程——>Schematic Library新原理图库操作流程项目文件——>添加新的...到工程——>PCB Library新的PC 阅读详情

Digital Roots HDU - 1013 

The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value contains two or more digits, those digits are summed and the process is repeated. This is continued as long as necessary to obtain a single digit. 

For example, consider the positive integer 24. Adding the 2 and the 4 yields a value of 6. Since 6 is a single digit, 6 is the digital root of 24. Now consider the positive integer 39. Adding the 3 and the 9 yields 12. Since 12 is not a single digit, the process must be repeated. Adding the 1 and the 2 yeilds 3, a single digit and also the digital root of 39. 

Input

The input file will contain a list of positive integers, one per line. The end of the input will be indicated by an integer value of zero. 

Output

For each integer in the input, output its digital root on a separate line of the output. 

Sample Input

24
39
0

Sample Output

6
3

听取WA声一片,用int就WA。。

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
char s[1010];
int main()
{

    while(~scanf("%s",s)&&s[0]!='0')
    {
        int len,sum=0,n,i;
        len=strlen(s);
        for(i=0;i<len;i++)
            sum+=s[i]-'0';
        while(sum>=10)
        {
            n=sum;
            sum=0;
            while(n)
            {
                sum+=n%10;
                n/=10;
            }
        }
        printf("%d\n",sum);
    }
    return 0;
}

 

AI Agent开发第82课-手把手教你把paddleocr-vl做成mcp使其在DIFY里运行 本文详解如何将国产顶尖多模态 OCR 模型 PaddleOCR-VL 封装为标准 MCP(Model Calling Protocol)服务,并通过自研的 HTTP-based MCP Client 接入 Dify 1.10,实现 AI Agent 在对话中自动识别并调用 OCR 能力。该方案已在某头部保险公司真实业务流程中落地,使用了当前最先进的“Agentic AI 原生”设计思想。 阅读详情

相关推荐

一文介绍Linux EAS

EAS只在系统负载不重时,即系统中每个CPU的利用率都低于其算力的80%时才被启用,而且选出的最节能CPU只有比线程当前运行的CPU节约能量大于6%时,线程才会迁移到该CPU运行。因此EAS为线程选择最节约能量的CPU来运行的前提条件是很苛刻的,针对重载场景(比如游戏),EAS的功能应该很少被使用起来,针对重载场景的功耗优化,这里可能是一个值得尝试的点。算力(capacity)是CPU调度中的一个基础概念,它反映的是一个CPU的计算能力,是个规格化的值,可以通过读取Android手机的文件节点。

youzhangjing_的博客 1234

Digital Root(九度教程第 42 题);

Digital Root(九度教程第 42 题) 1.题目描述: The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If...

qq_37053885的博客 1351

CST-Python(Pycharm如何与CST联合仿真,获取S参数)

我们想使用Python与CST联合仿真,其实是不需要自己下载Python的,因为CST在下载的时候就自带了Python3.6,我们只需要找到并将软件的环境设置到相应位置,即可联合仿真。(我的保存路径为D:\Program Files (x86)\CST Studio Suite 2020,在寻找时可以将前面切换成自己的保存路径,后面不需要修改)在CST帮助文档(打开CST软件,按F11即可直接访问帮助文档)里面,进行如下操作,便可以看到CST适配的Python版本为Python3.6!

weixin_52696285的博客 5648

c语言oj1124,九度OJ 1124 Digital Roots -- 數位拆解

題目描述:The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value contains...

weixin_34447182的博客 214

【模拟电子设计实战】开源!基于Multisim与AD620的心电采集电路仿真与优化

本文详细介绍了基于Multisim与AD620的心电采集电路仿真与优化实战。通过分析心电信号采集的挑战,重点讲解了AD620仪表放大器和OP07运算放大器的选型优势及电路设计技巧,包括对抗50Hz工频干扰和基线漂移的优化方法。文章还分享了Multisim仿真参数设置与实测对比经验,最终实现性能达标的心电采集电路设计。

weixin_30555125的博客 95

头歌操作系统 课后作业4.3:段页式内存管理 答案 无解析

头歌操作系统 课后作业4.3:段页式内存管理 答案 无解析

kercii的博客 7350

hud 1013 求一个数的数字根(合九法||模拟)

题目链接:点击打开链接The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value co...

Never__give__up的博客 816

车辆网络安全ISO/SAE 21434解读(一)概述

ISO/SAE 21434 《道路车辆 网络安全工程》是SAE和ISO共同制定的一项针对道路车辆的网络安全标准,它是一个面向汽车行业全供应链(OEM及各级供应商)的车辆网络安全管理指导文件

xiaoxiabang的博客 8424

杭电ACM 1013 Digital Roots

Problem Description The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resultin

知之者不如好之者,好之者不如乐之者 859

第55篇:数据隐私保护技术盘点——差分隐私、同态加密与它们的坑(踩坑总结)

数据隐私保护是AI工程化中必须严肃对待的课题。差分隐私和同态加密是两把利器,但也都是“重武器”,使用不当反而会伤及自身。差分隐私像“模糊处理”,通过加噪来保证统计安全性,要小心管理隐私预算和效用权衡。同态加密像“保险箱里打算盘”,保证了计算的精确性,但必须承受巨大的性能和工程复杂度代价。我的建议是:从小规模实验开始,先用DP-SGD在MNIST/CIFAR-10等标准数据集上感受噪声与精度的关系;再用TenSEAL等易用的库尝试一个加密逻辑回归,体会密文膨胀和速度延迟。

ai_blue_pm的博客 281

全志F1C100S/F1C200S学习笔记(1)——基础简介及资料

资料: 荔枝派资料下载站 荔枝派github 荔枝派中文论坛 荔枝派DIY-github资料 荔枝派Nano 全流程指南 芒果派 坑网

丨晋丨 1万+

计算机考研机式刷题系列之Digital Roots

题目来源 牛客网 Digital Roots 题目描述 The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the r...

Eugene__Li的博客 603

VAY 是 SAP 自动科目确定(OBYC-GBB)中的科目修改码,专用于带科目分配对象的销售订单发货场景,核心是触发 “Dr 成本要素科目(如销售费用 / 特定成本对象) Cr 库存商品” 的分录,

摘要:VAY是SAP中用于带科目分配对象(如成本中心、WBS)的销售订单发货的科目修改码,与标准VAX场景不同,它生成"借成本要素科目/贷库存商品"的分录。配置路径为OBYC-GBB-VAY,需确保借方科目为成本要素。典型业务场景包括免费样品、项目专用发货等。常见问题包括VAY未触发或科目记账错误,需检查销售订单科目分配、移动类型设置及OBYC配置。特殊场景建议单独配置科目以便费用分析。

金牌架构师 1253

HDU1013 Digital Roots

题目:HDU1013        题意为读入一个整数求他的Digital Roots         注意:读入的整数可能很长,用int ,long long可能都会WA,考虑使用字符串。       方法一:每读入一个字符,将其转化为数字后与sum相加,sum为最后的结果。                     代码:#include #include using namespace

师者为王 2605

efm32 入门.pdf

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

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

hdu 1013 Digital Roots

hdu 1013 Digital Roots The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the result...

博客——XiaoTang 254

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

【基础题】HDU1013 Digital Roots

题目 HDU1013 Digital Roots 题目分析 这个题就是求一个数的数根,就是计算各个位上数字的和,如果和是个位数,那么数根就是这个个位数,否则就重复这种计算直至各个位上数字之和为个位数。比如39->3,9->12->1,2->3,所以39的数根为3。 解这个题用到了数论当中的九余数定理,就是一个数除以9的余数与这个数各个位数数字之和除以9的余数相等。我们可以知...

vxiao_shen_longv的博客 290

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

hdu1013 (Digital Roots)

hdu1013 (Digital Roots) 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1013 Problem Description The digital root of a positive integer is found by summing the digits of the integer. If the resulting v...

weixin_41568105的博客 266

HDU_1013 Digital roots

Digital Roots HDU - 1013 The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resu...

yft1023的博客 248

hdu1013 Digital Roots

热烈庆祝本人于2013.1.22正式开张,路过的都顶啊!     本题是hdu1013   Digital Roots  .原题地址http://acm.hdu.edu.cn/showproblem.php?pid=1013  .题意简单明了的一道水题,就是让你把输入的数每一位数字相加,得数再做如此操作,直到只剩一位时输出结果.     测试样例可能会很大,整形必然存不下,所以考虑怎么扩长.

slicer的技术交流栈 670

hdu-1013 Digital Roots

题目来源:hdu-1013 Digital Roots Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 59825 Accepted Submission(s): 18723 Problem Description

暮光乐鱼的博客 550

【HDU】1013 Digital Roots

【代码】【HDU】1013 Digital Roots。

多言数穷,不如守中。十语九中,未必称奇;一语未中,愆尤骈集。 577

hdu 【1013】Digital Roots

Digital Roots Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 66831    Accepted Submission(s): 20880 Problem Description The digital ro

你真的介意真的在乎真的想要真的渴望的话你一定能够做到 980

HDU 1013 Digital Roots

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1013

mullerwch的专栏 550

hdu1013Digital Roots

Digital Roots Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 91251    Accepted Submission(s): 28397http://acm.hdu.edu.cn/showproblem...

一只秀逗__的博客 242
上一篇: Who's in the Middle
下一篇: Let the Balloon Rise HDU - 1004
RR-RR
博客等级 码龄10年 23粉丝 66原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值