數(shù)字運算,判斷一個數(shù)是否接近素數(shù)
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
See Appendix B for a description of the programs included
on this companion disk. RESOURCE.WRI identifies other books
and resources for Internet programming. WEBHELP.HLP contains
an introduction to the World Wide Web. TCPMAN.HLP provides
detailed instructions to help you use the Trumpet Winsock
included on this disk. Use the Program Manager s File menu
Run option to execute the SETUP.EXE program found on this
disk. SETUP.EXE will install the programs on your hard drive
and create an Internet Programming group window.
Internet編程技術(shù) [配套程序]
[涉及平臺] VC
[作者] void
[文件大小] 1032K
The HD66773, controller driver LSI, displays 132RGB-by-176 dot graphics on TFT displays in 260,000
colors. The HD66773’s bit-operation functions, 18-bit high-speed bus interface, and high-speed RAMwrite
functions enable efficient data transfer and high-speed rewriting of data to the graphic RAM.
ITU-T Recommendation V.90 98年9月版本
A DIGITAL MODEM AND ANALOGUE MODEM PAIR FOR USE ON THE PUBLIC SWITCHED TELEPHONE NETWORK (PSTN) AT DATA SIGNALLING RATES OF UP TO 56 000 bit/s DOWNSTREAM AND UP TO 33 600 bit/s UPSTREAM