数字运算,判断一个数是否接近素数 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
The C# program will display a mine field, plant mines, and provide hints on the number of mines around each grid. The player can therefore enjoy a typical Minesweeper game on a Smartphone.
标签: mines program display provide
上传时间: 2013-12-19
上传用户:xuanjie
Writing an interactive Java program with a graphical user interface (GUI) running on the Java phone emulator bundled with J2ME Wireless Toolkit 2.2 or Sun Java Wireless Toolkit 2.3 Beta Release. The Jave program will provide a tic-tac-toe board for two players to play a typical tic-tac-toe game on a Java mobile phone.
标签: Java interactive graphical interface
上传时间: 2014-01-22
上传用户:xuanjie
Writing an interactive Java program with a graphical user interface (GUI) running on the Java phone emulator bundled with J2ME Wireless Toolkit 2.2 or Sun Java Wireless Toolkit 2.3 Beta Release. The Jave program will provide a Gobang board for two players to play a typical Gobang game on a Java mobile phone.
标签: Java interactive graphical interface
上传时间: 2015-06-05
上传用户:LouieWu
源代码\用动态规划算法计算序列关系个数 用关系"<"和"="将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
The government of a small but important country has decided that the alphabet needs to be streamlined and reordered. Uppercase letters will be eliminated. They will issue a royal decree in the form of a String of B and A characters. The first character in the decree specifies whether a must come ( B )Before b in the new alphabet or ( A )After b . The second character determines the relative placement of b and c , etc. So, for example, "BAA" means that a must come Before b , b must come After c , and c must come After d . Any letters beyond these requirements are to be excluded, so if the decree specifies k comparisons then the new alphabet will contain the first k+1 lowercase letters of the current alphabet. Create a class Alphabet that contains the method choices that takes the decree as input and returns the number of possible new alphabets that conform to the decree. If more than 1,000,000,000 are possible, return -1. Definition
标签: government streamline important alphabet
上传时间: 2015-06-09
上传用户:weixiao99
This was the public transportation inquiry system software engineering design documents, including the demand analysis, the outline design, the contact surface design and so on a series of designs documents, made the comprehensive analysis to the public transportation systems engineering to design ,Java,software engineering
标签: transportation engineering documents including
上传时间: 2015-08-15
上传用户:lixinxiang
This was the public transportation inquiry system software engineering design documents, including the demand analysis, the outline design, the contact surface design and so on a series of designs documents, made the comprehensive analysis to the public transportation systems engineering to design ,Java,software
标签: transportation engineering documents including
上传时间: 2013-12-26
上传用户:Zxcvbnm
This was the public transportation inquiry system software engineering design documents, including the demand analysis, the outline design, the contact surface design and so on a series of designs documents, made the comprehensive analysis to the public transportation systems engineering to design ,Java
标签: transportation engineering documents including
上传时间: 2015-08-15
上传用户:caixiaoxu26
This was the public transportation inquiry system software engineering design documents, including the demand analysis, the outline design, the contact surface design and so on a series of designs documents, made the comprehensive analysis to the public transportation systems engineering to
标签: transportation engineering documents including
上传时间: 2015-08-15
上传用户:时代电子小智