Digital Roots
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
原创
2023-05-05 18:26:12
63阅读
1 #include 2 #include 3 #include 4 #include 5 #include 6 using namesp
原创
2022-05-25 10:39:47
82阅读
Problem DescriptioThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then ...
转载
2014-03-29 14:38:00
124阅读
2评论
DescriptionThe 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 valu
原创
2023-04-14 00:28:09
45阅读
ots Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) T
转载
2017-07-07 15:42:00
56阅读
2评论
Digital RootsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 29353Accepted Submission(s): 8974Problem DescriptionThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then tha
原创
2021-07-29 16:26:04
129阅读
题目大意:将给出的一个大数各位数字相加,得到一个新的数,再将这个数字各位数字相加,依次计算,直到变成一个个位数,这个数就被称为这个大数的Digital Roots。现在要求得到这个数。单词积累:digit 位,数字题解:其实这道题目根本就不需要高精度计算,一开始,直接将各位数字相加,和就在int的范围内了,然后就可以直接算了。#include #include int main(){ char s[1000]; int n; while(scanf("%s",s),s[0]!='0') { n=0; for(int i=0; i9...
转载
2014-01-17 16:28:00
47阅读
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1013水题我的方法是当做字符串进行处理,算完和之后,再用一次sprintf,将int数值转换为字符串,在进行求和操作,直到满足条件。。。。。#include<stdio.h>#include<string.h>int main() { char s[10001]; memset(s, '
原创
2021-06-29 14:43:02
179阅读
BackgroundThe 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 dig
转载
2017-03-08 18:01:00
115阅读
2评论
Digital RootsProblem DescriptionThe 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.
转载
2014-03-24 18:08:00
70阅读
2评论
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1013水题我的方法是当做字符串进行处理,算完和之后,再用一次sprintf,将int数值转换为字符串,在进行求和操作,直到满足条件。。。。。#include<stdio.h>#include<string.h>int main() { char s[10001]; memset(s, '
原创
2022-02-15 11:15:12
47阅读
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 resulting
原创
2022-05-14 11:47:34
136阅读
Digital Roots Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 19 Accepted Submission(s) : 7Font: Times New Roman | Verdana | Georgia Fon
原创
2022-12-02 00:28:44
50阅读
题目链接:hdu 1013 Digital Roots 题目大意:给出一个数num,计算num每一个位数上的值之和,的到新的num,如果num>= 10, 重复操作,直到为个数。 解题思路:第一次输入的时候位数很多,得用字符串读入。 #include #include #include const int N = 1
转载
2013-11-01 18:39:00
49阅读
2评论
Digital Roots Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 68194 Accepted Submission(s): 21324
转载
2016-05-21 09:55:00
52阅读
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 result...
原创
2023-05-09 10:01:00
29阅读