這是一個詞法分析器,、實驗內(nèi)容: 1. 設(shè)計掃描器的自動機; 2. 設(shè)計翻譯、生成Token的算法; 3. 編寫代碼并上機調(diào)試運行通過。 • 要求:輸入——源程序文件; 輸出——(1)相應(yīng)的Token序列; (2)關(guān)鍵字、界符表,符號表,常數(shù)表。
標(biāo)簽: 分析器
上傳時間: 2015-03-25
上傳用戶:fhzm5658
給定字符串,按照英文字母、數(shù)字、符號順序排序算法
標(biāo)簽: 字符串
上傳時間: 2013-12-16
上傳用戶:Shaikh
數(shù)字運算,判斷一個數(shù)是否接近素數(shù) 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
上傳時間: 2015-05-21
上傳用戶:daguda
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
標(biāo)簽: government streamline important alphabet
上傳時間: 2015-06-09
上傳用戶:weixiao99
電力系統(tǒng)在臺穩(wěn)定計算式電力系統(tǒng)不正常運行方式的一種計算。它的任務(wù)是已知電力系統(tǒng)某一正常運行狀態(tài)和受到某種擾動,計算電力系統(tǒng)所有發(fā)電機能否同步運行 1運行說明: 請輸入初始功率S0,形如a+bi 請輸入無限大系統(tǒng)母線電壓V0 請輸入系統(tǒng)等值電抗矩陣B 矩陣B有以下元素組成的行矩陣 1正常運行時的系統(tǒng)直軸等值電抗Xd 2故障運行時的系統(tǒng)直軸等值電抗X d 3故障切除后的系統(tǒng)直軸等值電抗 請輸入慣性時間常數(shù)Tj 請輸入時段數(shù)N 請輸入哪個時段發(fā)生故障Ni 請輸入每時段間隔的時間dt
標(biāo)簽: 電力系統(tǒng) 正 計算 運行
上傳時間: 2015-06-13
上傳用戶:it男一枚
這里面包含兩個文件,可以實現(xiàn)主成分分析(PCA)算法和線性判別分析(LDA)算法。不過還需要CMatrix類的定義。
標(biāo)簽:
上傳時間: 2015-09-09
上傳用戶:wfl_yy
上下文無關(guān)文法(Context-Free Grammar, CFG)是一個4元組G=(V, T, S, P),其中,V和T是不相交的有限集,S∈V,P是一組有限的產(chǎn)生式規(guī)則集,形如A→α,其中A∈V,且α∈(V∪T)*。V的元素稱為非終結(jié)符,T的元素稱為終結(jié)符,S是一個特殊的非終結(jié)符,稱為文法開始符。 設(shè)G=(V, T, S, P)是一個CFG,則G產(chǎn)生的語言是所有可由G產(chǎn)生的字符串組成的集合,即L(G)={x∈T* | Sx}。一個語言L是上下文無關(guān)語言(Context-Free Language, CFL),當(dāng)且僅當(dāng)存在一個CFG G,使得L=L(G)。 *⇒ 例如,設(shè)文法G:S→AB A→aA|a B→bB|b 則L(G)={a^nb^m | n,m>=1} 其中非終結(jié)符都是大寫字母,開始符都是S,終結(jié)符都是小寫字母。
標(biāo)簽: Context-Free Grammar CFG
上傳時間: 2013-12-10
上傳用戶:gaojiao1999
CJ.Lin的著名軟件:LibSVM,實現(xiàn)的是SVM分類、回歸的快速算法。在Matlab 7.0環(huán)境下直接調(diào)用。
上傳時間: 2013-12-25
上傳用戶:源碼3
一個很好用的大整數(shù)的類, 最大可支持9999990位的十進(jìn)制整數(shù), 可進(jìn)行大整數(shù)的加、減、乘、除和取模運算,并帶有求大整數(shù)的 最大公因數(shù)、擴(kuò)展Euclidean算法、中國剩余定理算法、 Miller-Rabin素性測試算法、隨機生成任意位的大整數(shù)等函數(shù)庫, 這個類的動態(tài)庫曾用于商業(yè)軟件之中,其可靠性和速度是得到 確認(rèn)的。用于商業(yè)目的可能需要注冊。
標(biāo)簽: 9999990 整數(shù) 十進(jìn)制
上傳時間: 2015-09-30
上傳用戶:王慶才
一本經(jīng)典實用的C語言數(shù)字信號處理書籍(有理論講解并附帶C程序),包含各種經(jīng)典數(shù)字信號處理,現(xiàn)代數(shù)字信號處理。并有部分神經(jīng)網(wǎng)絡(luò)算法、圖象處理算法程序。
標(biāo)簽: C語言 C程序 數(shù)字信號處理 書籍
上傳時間: 2013-12-19
上傳用戶:ddddddos
蟲蟲下載站版權(quán)所有 京ICP備2021023401號-1