数字运算,判断一个数是否接近素数 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
列举了Matlab6.0图形图像所有的处理函数,以及详细的例子
上传时间: 2013-12-27
上传用户:jackgao
雷达信号的MATLAB仿真常常是因为运算时间问题而失败,经过试验,在实际编程中,采用调用子函数方法就遇到该问题,为此,改为采用的查表法实现,有效解决了该问题。故将该源码上传供同行参考。
上传时间: 2013-12-27
上传用户:sssl
51单片机仿真器实验 通信程序
上传时间: 2013-12-18
上传用户:xiaodu1124
USB驱动芯片sl811h的驱动程序,很完整,效果不错,值得参考
上传时间: 2015-06-03
上传用户:叶山豪
這是java tutorial的第三版,包換對java,xml,servlet等的介紹
上传时间: 2015-06-03
上传用户:zhangyi99104144
用vb编写的usb转I2c例子,源自网上!
上传时间: 2014-01-03
上传用户:凤临西北
关联规则挖掘发现大量数据中项集之间有趣的关联或相关联系,管理员要通过啊,我很努力的找的啊
上传时间: 2013-12-03
上传用户:exxxds
Linux下 MTD源代码分析,针对nand flash和nor flash的驱动开发
上传时间: 2015-06-07
上传用户:wxhwjf
源代码\用动态规划算法计算序列关系个数 用关系"<"和"="将3个数a,b,c依次序排列时,有13种不同的序列关系: a=b=c,a=b<c,a<b=v,a<b<c,a<c<b a=c<b,b<a=c,b<a<c,b<c<a,b=c<a c<a=b,c<a<b,c<b<a 若要将n个数依序列,设计一个动态规划算法,计算出有多少种不同的序列关系, 要求算法只占用O(n),只耗时O(n*n).
上传时间: 2013-12-26
上传用户:siguazgb