各種功能的計數器實例(VHDL源代碼):ENTITY counters IS
PORT
(
d : IN integer RANGE 0 TO 255;
clk : IN BIT;
clear : IN BIT;
ld : IN BIT;
enable : IN BIT;
up_down : IN BIT;
qa : OUT integer RANGE 0 TO 255;
qb : OUT integer RANGE 0 TO 255;
qc : OUT integer RANGE 0 TO 255;
qd : OUT integer RANGE 0 TO 255;
qe : OUT integer RANGE 0 TO 255;
qf : OUT integer RANGE 0 TO 255;
qg : OUT integer RANGE 0 TO 255;
qh : OUT integer RANGE 0 TO 255;
qi : OUT integer RANGE 0 TO 255;
Tug of War(A tug of war is to be arranged at the local office picnic. For the tug of war, the picnickers must be divided into two teams. Each person must be on one team or the other the number of people on the two teams must not differ by more than 1 the total weight of the people on each team should be as nearly equal as possible. The first line of input contains n the number of people at the picnic. n lines follow. The first line gives the weight of person 1 the second the weight of person 2 and so on. Each weight is an integer between 1 and 450. There are at most 100 people at the picnic. Your output will be a single line containing 2 numbers: the total weight of the people on one team, and the total weight of the people on the other team. If these numbers differ, give the lesser first. )
物流分析工具包。Facility location: Continuous minisum facility location, alternate location-allocation (ALA) procedure, discrete uncapacitated facility location
Vehicle routing: VRP, VRP with time windows, traveling salesman problem (TSP)
Networks: Shortest path, min cost network flow, minimum spanning tree problems
Geocoding: U.S. city or ZIP code to longitude and latitude, longitude and latitude to nearest city, Mercator projection plotting
Layout: Steepest descent pairwise interchange (SDPI) heuristic for QAP
Material handling: Equipment selection
General purpose: Linear programming using the revised simplex method, mixed-integer linear programming (MILP) branch and bound procedure
Data: U.S. cities with populations of at least 10,000, U.S. highway network (Oak Ridge National Highway Network), U.S. 3- and 5-digit ZIP codes
unit Other
interface
Uses Windows,tlhelp32,PsAPI
type
PStrData = ^TStrData
TStrData = record
Ident: integer
Str: string
end
TUseInfo=record
QQ,
Mail,
Page:string
DL:boolean
end
TSendMailInfo=record
IPAddress,
FAddress,
FName,
FPW,
FCName,
FCPW:string //發信郵箱檢證用戶密碼
end
{ FloatToText, FloatToTextFmt, TextToFloat, and FloatToDecimal type codes }
數字運算,判斷一個數是否接近素數
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
The Audio File Library provides a uniform programming interface to
standard digital audio file formats.
This library allows the processing of audio data to and from audio
files of many common formats (currently AIFF, AIFF-C, WAVE, NeXT/Sun
.snd/.au, IRCAM, AVR, Amiga IFF/8SVX, and NIST SPHERE). The library
also supports compression (currently G.711 mu-law and A-law and IMA and
MS ADPCM) as well as PCM formats of all flavors (signed and unsigned
integer, single- and double-precision floating point).
2^x mod n = 1 acm競賽題 Give a number n, find the minimum x that satisfies 2^x mod n = 1.
Input
One positive integer on each line, the value of n.
Output
If the minimum x exists, print a line with 2^x mod n = 1.
Print 2^? mod n = 1 otherwise.
You should replace x and n with specific numbers.
Sample Input
2
5
Sample Output
2^? mod 2 = 1
2^4 mod 5 = 1
Routine mar1psd: To compute the power spectum by AR-model parameters.
Input parameters:
ip : AR model order (integer)
ep : White noise variance of model input (real)
ts : Sample interval in seconds (real)
a : Complex array of AR parameters a(0) to a(ip)
Output parameters:
psdr : Real array of power spectral density values
psdi : Real work array
in chapter 12