数字运算,判断一个数是否接近素数 A Niven number is a number such that the sum of its digits divides itself. For example, 111 is a Niven number because the sum of its digits is 3, which divides 111. We can also specify a number in another base b, and a number in base b is a Niven number if the sum of its digits divides its value. Given b (2 <= b <= 10) and a number in base b, determine whether it is a Niven number or not. Input Each line of input contains the base b, followed by a string of digits representing a positive integer in that base. There are no leading zeroes. The input is terminated by a line consisting of 0 alone. Output For each case, print "yes" on a line if the given number is a Niven number, and "no" otherwise. Sample Input 10 111 2 110 10 123 6 1000 8 2314 0 Sample Output yes yes no yes no
上传时间: 2015-05-21
上传用户:daguda
数值分析 一个上学的时候经常会到的小小的程序。希望对大家有一点的帮助。
上传时间: 2014-01-04
上传用户:huyiming139
科学与工程数值计算算法(Visual Basic版) 附赠的光盘包含了本书中全部的源代码
上传时间: 2013-12-27
上传用户:chens000
MCS-51 浮点运算子程序库及其使用说明
上传时间: 2015-05-22
上传用户:gundamwzc
1、说明: 本书中所有的常用数值算法子过程按书中的章数分别放在以C开头的子目录中。 所有这些为验证上述子过程而编的验证过程按书中的章数分别放在以D开头的子目录中。 所有为验证过程而做的工程,按书中的章数分别放在以V开头的子目录中。 2、使用: 1)最简单的做法是若D盘有大于50M的空间,读者只须将光盘上的子目录“DELPHI_SHU”
上传时间: 2015-05-22
上传用户:sy_jiadeyi
dsp实验箱的实验一:基本数学运算,dsp入门的好例子
上传时间: 2015-05-24
上传用户:zhaiye
多项式的加法和乘法运算,是一个数据结构的课程设计,根据数据结构的算法,实现运算,一份完整的课程设计,包括运行结果
上传时间: 2015-05-24
上传用户:gtf1207
此程序为VC++常用数值算法这本书附赠的光盘中包含了本书中全部的源代码
上传时间: 2013-12-08
上传用户:stewart·
此代码为VC++常用数值算法这本书中附赠的光D部分的源代码,C部分得我已经传了
上传时间: 2015-05-24
上传用户:黄华强
数值拟合与逼近方面的,包括:最小二乘曲线拟合,切比雪夫曲线拟合,最佳一致逼近多项式里米慈法,矩形域的最小二乘曲面拟合
上传时间: 2013-12-25
上传用户:helmos