登录
首页 » 其他项目 » 数根 数也有根吗?有!数根就是把一个数的各个数位上的值相加,直到得到一个一位数为止。请你编写一个程序来计算任意数N(0≤N≤1000000000000)的...

数根 数也有根吗?有!数根就是把一个数的各个数位上的值相加,直到得到一个一位数为止。请你编写一个程序来计算任意数N(0≤N≤1000000000000)的...

于 2023-09-05 发布 文件大小:609.00 B
0 140
下载积分: 2 下载次数: 1

代码说明:

数根 数也有根吗?有!数根就是把一个数的各个数位上的值相加,直到得到一个一位数为止。请你编写一个程序来计算任意数N(0≤N≤1000000000000)的根。 输入: 输入有多个案例。每一个案例为一行,每行只有一个整数N。当输入的N是-1时,输入结束。 输出: 每一个案例输出一行。每行只有一个数字,就是N对应的数根。 Sample input 39 -1 Sample output 3-Number of root number also has roots do? There is! The number of roots is to a number of different values on the digital sum until they have been a number of up to one. Please write a program to calculate an arbitrary number N (0 ≤ N ≤ 1000000000000) roots. Input: Enter a number of cases. Each case for the line, each line is only an integer N. When the input of N is-1, the input end. Output: the output line of each case. There is only one number per line, that is, N corresponds to the number of roots. Sample input 39-1 Sample output 3

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论


0 个回复

  • Beautiful Code is a useful book for programming.
    代码之美,对于编程的学习非常有帮助。能够规范代码的编写,是一本值得一看的好书。-Beautiful Code is a useful book for programming.
    2022-03-02 22:06:25下载
    积分:1
  • 各种PID控制算法的MATLAB源程序,可以结合相应的指导书学习
    各种PID控制算法的MATLAB源程序,可以结合相应的指导书学习-various PID control algorithm MATLAB source, combining the corresponding study guide book
    2022-11-01 03:50:03下载
    积分:1
  • BMP converted to ultra
    BMP转换为JGP源码,不使用第三方控件-BMP converted to ultra-source, non-use of third-party controls
    2022-06-29 07:21:18下载
    积分:1
  • 获得OLE信息。
    获得OLE信息。-OLE information access.
    2022-04-20 20:14:10下载
    积分:1
  • 编译原理NFA到DFA的转换源码
    编译原理NFA到DFA的转换源码-compiler theory NFA to the DFA source conversion
    2022-04-30 00:29:25下载
    积分:1
  • " Data Structure" class
    《数据结构》 课设 利用栈计算浮点数的加,减,乘,除,有一定的判错功能-" Data Structure" class-based calculation of floating-point increases in the use of the stack, subtract, multiply, divide, there is a certain sub-error functions
    2022-05-19 06:19:40下载
    积分:1
  • a written using java mobile phone games
    一个用java写的手机游戏-五子棋,界面做的欠缺了点.-a written using java mobile phone games- 331 interface so the lack of points.
    2022-09-16 20:15:03下载
    积分:1
  • 利用GOSSIP协议可以实现无线节点之间的路由选择.
    利用GOSSIP协议可以实现无线节点之间的路由选择.-use GOSSIP agreement can be achieved between the wireless node routing.
    2022-04-08 03:58:00下载
    积分:1
  • 让GCD(A,B),没有递归
    to get GCD(A,B),and no recursion -to get GCD(A,B),and no recursion
    2023-07-26 13:25:03下载
    积分:1
  • Spikes can be taken as absolute quantities of measuring values which are large t...
    Spikes can be taken as absolute quantities of measuring values which are large than approximately four (expressed as variable [Times_SD] in the program)times of the standard deviation of the time series, and can be removed by repeating 3 times with each time series. When a measuring value with the deviation from the mean larger than four times of the standard deviation, the variable can be taken as NO_VALUE, and the number of spikes is saved into the variable [SpikeNum]. If the variable [Times_SD] is taken as four, many records will be removed, so the variable [Times_SD] can be taken as larger, for example eight. -Hasan can be taken as absolute quantities of measuring values which are large than approx imately four (expressed as variable [Times_SD ] in the program) times of the standard deviatio n of the time series. and can be removed by repeating three times with each time series. When a measuring value with the dev iation from the mean larger than four times of th e standard dev
    2023-02-22 23:35:03下载
    积分:1
  • 696518资源总数
  • 104600会员总数
  • 46今日下载