5 ledblink -- 跑馬燈程序
該項(xiàng)目在SDT2.51下編譯調(diào)試。最簡(jiǎn)單的demo程序,運(yùn)行后3個(gè)發(fā)光二極管輪流點(diǎn)亮。
6 timerint -- 定時(shí)器中斷demo程序
該項(xiàng)目在SDT2.51下編譯調(diào)試。將子目錄timerint拷貝到c:\ 下。
該demo程序的主程序是while空循環(huán),定時(shí)器中斷服務(wù)程序每500ms將3個(gè)LED反相。
在57600超級(jí)終端里也可以看到中斷發(fā)生時(shí)的信息。
7 uart -- 串口測(cè)試程序
該項(xiàng)目在SDT2.51下編譯調(diào)試。運(yùn)行后在57600的超級(jí)終端里等待PC鍵盤的輸入,當(dāng)按下 a 或 b 或 c 按鍵時(shí),超級(jí)終端里將顯示 You Pressed a ,You Pressed b ,You Pressed c .
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