問題描述 設有n種不同面值的硬幣,各硬幣的面值存于數組T[1:n]中。現要用這些面值的硬幣來找錢,可以實用的各種面值的硬幣個數不限。當只用硬幣面值T[1],T[2],…,T[i]時,可找出錢數j的最少硬幣個數記為C(i,j)。若只用這些硬幣面值,找不出錢數j時,記C(i,j)=∞。 編程任務 設計一個動態規劃算法,對1≤j≤L,計算出所有的C( n,j )。算法中只允許實用一個長度為L的數組。用L和n作為變量來表示算法的計算時間復雜性 數據輸入 由文件input.txt提供輸入數據。文件的第1行中有1個正整數n(n<=13),表示有n種硬幣可選。接下來的一行是每種硬幣的面值。由用戶輸入待找錢數j。 結果輸出 程序運行結束時,將計算出的所需最少硬幣個數輸出到文件output.txt中。
標簽:
上傳時間: 2016-07-28
上傳用戶:yangbo69
crc_table.c is for reset seed( 0000 ) crc_table_1.c is for reset seed( ffff) CRC16_D8_m.v is a verilog module of byte paralle crc. CRC16_D8_m_tb.v is the testbench file of above module.
上傳時間: 2014-01-09
上傳用戶:181992417
This is the source for a C compiler that generates 386 or m68K code. Code generation is fairly good although the optimizer is a little naive... the code itself should be highly portable although there are some issues involved with porting from MSDOS that have to be resolved for example the size of LONG on unix machines is so big some of the code generated gets messed up. Code generation requires TASM to assemble the compiler output you can use the borland TLINK to produce executables, or the Watcom WLINK can also be used. PMODE systems written by TRAN are used for the DPMI interface.
標簽: generation generates compiler fairly
上傳時間: 2016-08-01
上傳用戶:sxdtlqqjl
① 使用自動機技術實現一個詞法分析程序; ② 使用算符優先分析方法實現其語法分析程序; 需要先在運行目錄下建立一個input.txt文件,將需要分析的文法放在該文件中,分析結果,會輸出在output.txt文件中。
上傳時間: 2013-12-09
上傳用戶:stampede
Flash中內置了一個狀態寄存器(Status Register,SR)來指示Flash的當前工作狀態和各種操作是否成功。要讀取SR的當前值需要向CUI發送讀狀態寄存器命令(Read Status Register),命令碼為0x70,SR中的內容將在DQ[7:0]上輸出。The Read Status Register (0x70)command causes subsequent reads to output data from the SR until another command is issued. The SR bits are output on DQ[7:0].
上傳時間: 2016-08-12
上傳用戶:thesk123
可編程并行接口8255A完成的交通燈實驗 用8255A的B端口和C端口控制12個LED的亮和滅(輸出為0則亮,輸出為1則滅),模擬十字路口的交通燈。 -programmable parallel interface 8255A completed, the traffic lights experimental 8255A port B and C - I control 12 LED bright and methomyl (output of 0-liang, the output of an anti), the simulation of traffic lights at a crossroads.
上傳時間: 2016-08-13
上傳用戶:來茴
RS232.C was written to provide all of the basic functionality needed to employ serial I/O in any application written with Borland C language compilers. Some features are: 1. Ease of use. No assembly language or library files are used and a simple "#include" statement is all that is required to access all of the functions provided. 2. Both input and output are buffered and interrupt driven for efficiency. 3. Serial ports 1 - 4 are supported on PC, AT and PS/2 compatibles.Chained interrupts used on port 3 and 4 are allowed for so as not to interfere with devices such as a mouse or printer. Transmission speeds of 110 to 115200 baud are available. 4. Detection and utilization of hardware buffered UARTs (NS16550AF etc.) found in some machines is automatic. 5. Interrupt driven hardware and XON/XOFF flow control is provided for. 6. All source code is included. RS232.C can be used with all memory models.
標簽: functionality provide written employ
上傳時間: 2016-08-24
上傳用戶:小眼睛LSL
a sample WDM stream class video capture driver that supports two IEEE 1394 digital cameras. The same driver may be able to support other digital cameras that conform to 1394-based Digital Camera Specification from 1394 Trade Association. Digital camera supported by dcam.sys is a data source that produces digital image data without any other input connection. It manifests itself in a DirectShow graph as a WDM Streaming Capture Device and as a capture filter that has output capture stream supporting image sizes of 320x240 with a UYVY color space. Its de-compressor, Msyuv.dll, is part of the OS delivery, and it can convert image data format from UYVY to RGB16, RGB8, or to a Direct Draw surface if the video card supports UYVY format.
標簽: supports capture cameras digital
上傳時間: 2014-01-13
上傳用戶:yph853211
MS-Clustering is designed to rapidly cluster large MS/MS datasets. The program merges similar spectra (having similar m/z values ?within a given tolerance), and creates a single consensus spectrum as a representative. The input formats accepted are: dta, mgf, mzXML. The output format is mgf.
標簽: MS-Clustering designed datasets cluster
上傳時間: 2013-12-20
上傳用戶:cursor
winavr code for avr mega8. The program get data from serial port in interrupt function. And then out put the data to 74ls595 (serial to parallel IC) for controlling relay output.
標簽: interrupt function program winavr
上傳時間: 2013-12-22
上傳用戶:cjl42111