數字運算,判斷一個數是否接近素數 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
Delineate is a tool for converting bitmap raster images to SVG (Scalable Vector Graphics) using AutoTrace or potrace. It displays SVG results using Apache Batik. Input formats are JPEG, PNG, GIF, BMP, TIFF, PNM, PBM, PGM, PPM, IFF,PCD, PSD, RAS.
標簽: converting Delineate Graphics Scalable
上傳時間: 2014-01-19
上傳用戶:四只眼
Decoding most of the infrared signals can be easily handled by PIC16C5X microcontrollers. This application note describes how this decoding may be done. The only mandatory hardware for decoding IR signals is an infrared receiver. The use of two types is described here. Both are modular types used often by the consumer electronics industry. The first type responds to infrared signals modulated at about 40 kHz. The second responds to non-modulated infrared pulses and has a restricted range. The hardware costs of each approach will be less than two dollars.
標簽: microcontrollers Decoding infrared handled
上傳時間: 2015-05-24
上傳用戶:ruan2570406
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
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
The JICQ is the bureau area which JAVA writes according to "Customer s Machine/Server"(C/S) mode message solid hour correspond by letter tool system, the system adopted the SQL Server2000 of Microsoft company as a backstage database, the system passes a JDBC interview database. The system is divided into the server procedure and customer s procedure two parts, server and customer adoption "Transmission Control Protocol"(TCP), connect a word (Socket) conjunction through a set, the adoption "User Datagram Protocol "(UDP) of the customer s, pass a data report a set to connect a word (DatagramSocket) establishment a conjunction. The system has customer registration, customer to register, increase good friend, delete good friend and send out and receive news etc. function.
標簽: according Customer Machine Server
上傳時間: 2014-01-04
上傳用戶:jyycc
This applet illustrates the prediction capabilities of the multi-layer perceptrons. It allows to define an input signal on which prediction will be performed. The user can choose the number of input units, hidden units and output units, as well as the delay between the input series and the predicted output series. Then it is possible to observe interesting prediction properties.
標簽: capabilities illustrates multi-layer perceptrons
上傳時間: 2015-06-17
上傳用戶:lnnn30
Single-layer neural networks can be trained using various learning algorithms. The best-known algorithms are the Adaline, Perceptron and Backpropagation algorithms for supervised learning. The first two are specific to single-layer neural networks while the third can be generalized to multi-layer perceptrons.
標簽: Single-layer algorithms best-known networks
上傳時間: 2015-06-17
上傳用戶:趙云興
Included are the files wav1.m, wav2.m, wavecoef.mat and readme. wav2 function implements the tree structured wavelet transform of the input matrix, up to the given level of decomposition. Wav2 uses another function called wav1, which takes the well known wavelet transform of the given matrix. Daubechies wavelet coefficients are used for wavelet transform operation wahich is saved in wavcoeff.mat.
標簽: implements the wav Included
上傳時間: 2015-06-23
上傳用戶:愛死愛死