数字运算,判断一个数是否接近素数 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
资源简介:Joseph Ring 算法
上传时间: 2024-09-20
上传用户:xtoqm
资源简介:windows系统下用java开发的网络入侵检测程序
上传时间: 2024-09-20
上传用户:menglin330
资源简介:vc编程规范,比较详细的
上传时间: 2024-09-20
上传用户:sxmayd
资源简介:无线解码程序,是用于多种无线报警主机的解码
上传时间: 2024-09-20
上传用户:gordon_two
资源简介:16进制数转换成十进制
上传时间: 2024-09-20
上传用户:gupingdn
资源简介:数据结构课程设计 数据结构课程设计C语言版本
上传时间: 2024-09-20
上传用户:hehe6688
资源简介:学籍管理系统 系统是在VC++6.0和SQL Server 2000下开发的. 数据库在Database目录下,在SQLSERVER的查询分析器中执行即可生成数据库. 源程序在Src目录中. 因为程序极为经典,所以本人在此转载~ 一、编程环境: windows2000 +visual stdio c++ .net,Ado + SQ...
上传时间: 2024-09-20
上传用户:selenia123456
资源简介:发布java应用程序的同时发布jdk,然后可以通过这个小程序直接引导java应用程序,比用*.bat的批处理文件好看多了,没有那个讨厌的控制台窗口。【源代码,C++/C】
上传时间: 2024-09-20
上传用户:zhys