大整數乘法例子代碼 /* 遞歸邊界,如果是1位二進制數與1位二進制數相乘,則可以直接計算 */ /*累計做1位二進制乘法運算的次數*/ /* return (X*Y) */ /* 計算n的值 */ /* 把X和Y拆分開來,令X=A*2^(n/2)+B, 左移位運算,mod = 1<<(n/2) */ /* 計算XY=AC*2^n+(AD+CB)*2^(n/2)+BD */ /* 計算A*C,再向左移n位 */ /* 遞歸計算A*D */ /* 遞歸計算C*B */ /* 計算a21+a22,再向左移n/2位 */ /* 遞歸計算B*D */ /* XY=a1+a2+a3 */
上傳時間: 2015-05-19
上傳用戶:gyq
程序用JAVA語言編寫, 綜合利用圖結構和堆棧結構進行數據組織和處理. 可以進行正則表達式到NFA的轉化, 并能用圖形直觀的表示. 對正則表達式有一些約定, 就是可以用單個字符表示輸入, 也可以用 ‘ ‘ 連接起來的一串字符進行輸入. 有基本的表達式以及由基本表達式構成的并置, 選擇和重復的操作. 例: A|b*c ‘letter’*’digit’ 等都是合法輸入. 還帶有括號功能, 優先級
上傳時間: 2015-05-26
上傳用戶:金宜
gameboy游戲模擬器,COMMON.H CONV.C DASM.C DEBUG.C FILE_ID.DIZ FMFREQS.C FMFREQS.H GB.C GB.H GBLIST.C HELP.H IBMADLIB.C IBMASM.S IBMGIF.C IBMMSDOS.C IBMMSDOS.H IBMSB.C IBMSTACK.C KEYS.C LISTALL.C MAKEFILE TABLES.H TESTALL.C VGB-DOS.GIF VGB-DOS.TXT VGB.C Z80.C Z80.H
標簽: FMFREQS gameboy FILE_ID COMMON
上傳時間: 2015-05-27
上傳用戶:GavinNeko
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
/*** *** *** *** *** *** *** *** *** *** *** *** **/ //**此映射表用來映射LED模塊不譯碼時,顯示的字符和必須輸入的數據的關系 //**每段和對應比特位的關系見示意圖 // g // --- --- // b | a |f | | <---顯示0時點亮的段為gfedcb // --- // c | |e | | 那么寫入數據為0x7e // --- --- // d // bit: 7 6 5 4 3 2 1 0 // 段位: g f e d c b a
上傳時間: 2013-11-25
上傳用戶:
求解方程式的根的算法,要求輸入a,b,c 3個數據的值,輸出結果將顯示在方框內
上傳時間: 2015-10-31
上傳用戶:gtf1207
一:需求分析 1. 問題描述 魔王總是使用自己的一種非常精練而抽象的語言講話,沒人能聽懂,但他的語言是可逐步解釋成人能聽懂的語言,因為他的語言是由以下兩種形式的規則由人的語言逐步抽象上去的: ----------------------------------------------------------- (1) a---> (B1)(B2)....(Bm) (2)[(op1)(p2)...(pn)]---->[o(pn)][o(p(n-1))].....[o(p1)o] ----------------------------------------------------------- 在這兩種形式中,從左到右均表示解釋.試寫一個魔王語言的解釋系統,把 他的話解釋成人能聽得懂的話. 2. 基本要求: 用下述兩條具體規則和上述規則形式(2)實現.設大寫字母表示魔王語言的詞匯 小寫字母表示人的語言的詞匯 希臘字母表示可以用大寫字母或小寫字母代換的變量.魔王語言可含人的詞匯. (1) B --> tAdA (2) A --> sae 3. 測試數據: B(ehnxgz)B 解釋成 tsaedsaeezegexenehetsaedsae若將小寫字母與漢字建立下表所示的對應關系,則魔王說的話是:"天上一只鵝地上一只鵝鵝追鵝趕鵝下鵝蛋鵝恨鵝天上一只鵝地上一只鵝". | t | d | s | a | e | z | g | x | n | h | | 天 | 地 | 上 | 一只| 鵝 | 追 | 趕 | 下 | 蛋 | 恨 |
上傳時間: 2014-12-02
上傳用戶:jkhjkh1982
Thinking in C++ patiently and methodically explores the issues of when and how to use inlines, references, operator overloading, inheritance and dynamic objects, as well as advanced topics such as the proper use of templates, exceptions and multiple inheritance. The entire effort is woven in a fabric that includes Eckel’s own philosophy of object and program design. A must for every C++ developer’s bookshelf, Thinking in C++ is the one C++ book you must have if you’re doing serious development with C++.
標簽: methodically and patiently Thinking
上傳時間: 2014-01-03
上傳用戶:it男一枚
一個能夠分析三種整數、標識符、主要運算符和主要關鍵字的詞法分析程序。 ㈠、基本要求: 標識符 <字母>(<字母>|<數字字符>)* 十進制整數 0 | (1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)* 八進制整數 0(1|2|3|4|5|6|7)(0|1|2|3|4|5|6|7)* 十六進制整數 0x(0|1|2|3|4|5|6|7|8|9|a|b|c|d|e|f)(0|1|2|3|4|5|6|7|8|9|a|b|c|d|e|f)* 運算符和分隔符 + - * / > < = ( ) ; 關鍵字 if then else while do ㈡、附加要求: 標識符 <字母>(<字母>|<數字字符>)*(ε|_|.)(<字母>|<數字字符>)* 十進制整數 (0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)*(ε|.)(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)* 八進制整數 0(1|2|3|4|5|6|7)(0|1|2|3|4|5|6|7)* (ε|.)(0|1|2|3|4|5|6|7)(0|1|2|3|4|5|6|7)* 十六進制整數 0x(0|1|2|3|4|5|6|7|8|9|a|b|c|d|e|f)(0|1|2|3|4|5|6|7|8|9|a|b|c|d|e|f)* (ε|.) (0|1|2|3|4|5|6|7|8|9|a|b|c|d|e|f)(0|1|2|3|4|5|6|7|8|9|a|b|c|d|e|f)*
上傳時間: 2016-03-03
上傳用戶:zhengjian
rsa加密過程中需要大數的冪運算后求模,本程序即計算a的b次方的結果對c求模,其中a,b,c均為大自然數,編寫rsa加密的朋友可以作為參考(其實就是rsa的精華)
上傳時間: 2013-12-27
上傳用戶:myworkpost