解決時(shí)鐘問(wèn)題,acm競(jìng)賽題 A weird clock marked from 0 to 59 has only a minute hand. It won t move until a special coin is thrown into its box. There are different kinds of coins as your options. However once you make your choice, you cannot use any other kind. There are infinite number of coins of each kind, each marked with a number d ( 0 <= 1000 ), meaning that this coin will make the minute hand move d times clockwise the current time. For example, if the current time is 45, and d = 2. Then the minute hand will move clockwise 90 minutes and will be pointing to 15. Now you are given the initial time s ( 0 <= s <= 59 ) and the coin s type d. Write a program to find the minimum number of d-coins needed to turn the minute hand back to 0.
標(biāo)簽: 時(shí)鐘
上傳時(shí)間: 2015-05-21
上傳用戶:rishian
這個(gè)例子如果運(yùn)行,將在仿真的PC窗口中的第1,2,3行顯示一些信息后,在隨機(jī)位置顯示 1 ~ 5 .由于keil c51默認(rèn)不支持重入函數(shù),它的重入函數(shù)使用仿真的重入棧而不使用系統(tǒng)棧,而Small RTOS 51沒(méi)有進(jìn)行重入棧管理,所以在TaskA~TaskE雖然及其相似,但不能合并. 注意:(1)在KEIL C51 工程中,我已經(jīng)把輸出文件目錄設(shè)在e:\temp中,您可以在Project->Options for Target "Target 1"的output頁(yè)點(diǎn)擊Select Folder for Objects...和Listing頁(yè)點(diǎn)擊Select Folder for Listing...改變. (2)編譯時(shí)會(huì)有5個(gè)警告,其中一個(gè)是因?yàn)闆](méi)有使用一個(gè)系統(tǒng)函數(shù)OSSendSignal引起,它可以忽略.另4個(gè)是禁止任務(wù)間變量覆蓋分析引起,必須忽略.感謝網(wǎng)友John X. Liu,在這個(gè)例子中我使用了他編寫的仿真(dllPc51Emu.dll),這個(gè)dll原來(lái)是為他移植的Ucos-ii for keil c51的例子編寫. (3)Pc51Emu.dll在KEIL C51 V6.23 V7.00工作不正常.
上傳時(shí)間: 2015-05-29
上傳用戶:無(wú)聊來(lái)刷下
這個(gè)例子是例子2的另一種寫法(但任務(wù)數(shù)量不同),它使用了最高優(yōu)先級(jí)任務(wù)作為顯示任務(wù),全局變量ShowChar作為參數(shù).函數(shù)TaskB是優(yōu)先級(jí)1~10的任務(wù)函數(shù),因?yàn)闆](méi)有使用局部變量,這些任務(wù)可以用一個(gè)函數(shù). 注意:(1)在KEIL C51 工程中,我已經(jīng)把輸出文件目錄設(shè)在e:\temp中,您可以在Project->Options for Target "Target 1"的output頁(yè)點(diǎn)擊Select Folder for Objects...和Listing頁(yè)點(diǎn)擊Select Folder for Listing...改變. 感謝網(wǎng)友John X. Liu,在這個(gè)例子中我使用了他編寫的仿真dll(Pc51Emu.dll),這個(gè)dll原來(lái)是為他移植的Ucos-ii for keil c51的例子編寫. (2)Pc51Emu.dll在KEIL C51 V6.23 V7.00工作不正常.
標(biāo)簽: ShowChar TaskB 函數(shù) 10
上傳時(shí)間: 2015-05-29
上傳用戶:asddsd
Tiny C Compiler - C Scripting Everywhere - The Smallest ANSI C compiler Installation on a i386 Linux host (for Windows read win32/readme.txt) ./configure make make test make install By default, tcc is installed in /usr/local/bin. ./configure --help shows configuration options.
標(biāo)簽: Installation Everywhere Scripting Compiler
上傳時(shí)間: 2013-12-19
上傳用戶:zhangzhenyu
% [BestPop,Trace]=fmaxga(FUN,LB,UB,eranum,popsize,pcross,pmutation) % Finds a maximum of a function of several variables. % fmaxga solves problems of the form: % max F(X) subject to: LB <= X <= UB % BestPop--------最優(yōu)的群體即為最優(yōu)的染色體群 % Trace----------最佳染色體所對(duì)應(yīng)的目標(biāo)函數(shù)值 % FUN------------目標(biāo)函數(shù) % LB-------------自變量下限 % UB-------------自變量上限 % eranum---------種群的代數(shù),取100--1000(默認(rèn)1000) % popsize--------每一代種群的規(guī)模;此可取50--100(默認(rèn)50) % pcross---------交叉的概率,此概率一般取0.5--0.85之間較好(默認(rèn)0.8) % pmutation------變異的概率,該概率一般取0.05-0.2左右較好(默認(rèn)0.1) % options--------1×2矩陣,options(1)=0二進(jìn)制編碼(默認(rèn)0),option(1)~=0十進(jìn)制編碼,option(2)設(shè)定求解精度(默認(rèn)1e-4)
標(biāo)簽: pmutation BestPop popsize maximum
上傳時(shí)間: 2015-07-16
上傳用戶:Altman
LibTorrent is a BitTorrent library written in C++ for *nix, with a focus on high performance and good code. The library differentiates itself from other implementations by transfering directly from file pages to the network stack. On high-bandwidth connections it is able to seed at 3 times the speed of the official client. The client uses ncurses and is ideal for use with screen or dtach. It supports saving of sessions and allows the user to add and remove torrents.
標(biāo)簽: performance LibTorrent BitTorrent library
上傳時(shí)間: 2015-07-24
上傳用戶:冇尾飛鉈
使用方法:用文本方式打開(kāi)FlashFXP文件夾下的Sites.dat文件你會(huì)發(fā)現(xiàn)許多如下字段: [ftp://www.2ky.cn] Created=37525.5835161227 IP=www.realoveyou.com User=software Pass=45C170E56C99BB1A47 Port=21 Options=30033330000330011 將Pass=45C170E56C99BB1A47中等號(hào)后面的字串復(fù)制到FlashFXP密碼解密器里,按解密按鈕就得到真正的FTP明文密碼。 【MD5值:540ff30708aeaf8a33fdf4bd2fbd6006】
標(biāo)簽: 37525.5835161227 FlashFXP Created Sites
上傳時(shí)間: 2014-01-27
上傳用戶:亞亞娟娟123
When created, this DLL does not export any symbols. As a result, it will not produce a .lib file when it is built. If you wish this project to be a project dependency of some other project, you will either need to add code to export some symbols from the DLL so that an export library will be produced, or you can check the "doesn t produce lib" checkbox in the Linker settings page for this project.
標(biāo)簽: not created symbols produce
上傳時(shí)間: 2015-09-01
上傳用戶:asdkin
這是Small RTOS 51 在DP-51下載仿真實(shí)驗(yàn)儀上使用CAT24WC02驅(qū)動(dòng)程序的例子。本例程序按照相應(yīng)的的通訊協(xié)議接收一個(gè)數(shù)據(jù),并將接收到的數(shù)據(jù)顯示到LED數(shù)碼顯示器上。然后將接收到的數(shù)據(jù)寫入Cat24Wc02中,再在同一位置將數(shù)據(jù)讀出,并將讀出的數(shù)據(jù)通過(guò)串口發(fā)送回來(lái)。通訊協(xié)議參考rtos隨想曲和test.ini。 注意:(1)在KEIL C51 工程中,我已經(jīng)把輸出文件目錄設(shè)在e:\temp中,您可以在Project->Options for Target "Target 1"的output頁(yè)點(diǎn)擊Select Folder for Objects...和Listing頁(yè)點(diǎn)擊Select Folder for Listing...改變. (2)編譯時(shí)會(huì)有4個(gè)警告,可以忽略. (3)DP-51下載仿真實(shí)驗(yàn)儀的所有跳線選取默認(rèn)值。
上傳時(shí)間: 2015-09-03
上傳用戶:wweqas
這是Small RTOS 51 DP-51下載仿真實(shí)驗(yàn)儀上實(shí)現(xiàn)一個(gè)鬧鐘的源代碼。它可以使用k1~k4調(diào)整時(shí)間,使用串口設(shè)置一個(gè)報(bào)警時(shí)間。由于僅僅是一個(gè)例子而非產(chǎn)品,有一些細(xì)節(jié)沒(méi)有完善。如調(diào)整完時(shí)間后第一次顯示的時(shí)間是錯(cuò)誤的(由于共享TimeData引起);沒(méi)有使用串行eeprom存儲(chǔ)多個(gè)報(bào)警時(shí)間等;刪除報(bào)警代碼沒(méi)有編寫。不過(guò),程序已經(jīng)可以使用,讀者可以自行完善它。通訊協(xié)議參考rtos隨想曲和test.ini。 注意:(1)在KEIL C51 工程中,我已經(jīng)把輸出文件目錄設(shè)在e:\temp中,您可以在Project->Options for Target "Target 1"的output頁(yè)點(diǎn)擊Select Folder for Objects...和Listing頁(yè)點(diǎn)擊Select Folder for Listing...改變. (2)編譯時(shí)會(huì)有6個(gè)警告,可以忽略. (3)除與pcf8563相關(guān)的跳線和蜂鳴器的跳線外,DP-51下載仿真實(shí)驗(yàn)儀的所有跳線選取默認(rèn)值。
上傳時(shí)間: 2015-09-03
上傳用戶:jyycc
蟲(chóng)蟲(chóng)下載站版權(quán)所有 京ICP備2021023401號(hào)-1