一:需求分析 1. 問題描述 魔王總是使用自己的一種非常精練而抽象的語(yǔ)言講話,沒人能聽懂,但他的語(yǔ)言是可逐步解釋成人能聽懂的語(yǔ)言,因?yàn)樗恼Z(yǔ)言是由以下兩種形式的規(guī)則由人的語(yǔ)言逐步抽象上去的: ----------------------------------------------------------- (1) a---> (B1)(B2)....(Bm) (2)[(op1)(p2)...(pn)]---->[o(pn)][o(p(n-1))].....[o(p1)o] ----------------------------------------------------------- 在這兩種形式中,從左到右均表示解釋.試寫一個(gè)魔王語(yǔ)言的解釋系統(tǒng),把 他的話解釋成人能聽得懂的話. 2. 基本要求: 用下述兩條具體規(guī)則和上述規(guī)則形式(2)實(shí)現(xiàn).設(shè)大寫字母表示魔王語(yǔ)言的詞匯 小寫字母表示人的語(yǔ)言的詞匯 希臘字母表示可以用大寫字母或小寫字母代換的變量.魔王語(yǔ)言可含人的詞匯. (1) B --> tAdA (2) A --> sae 3. 測(cè)試數(shù)據(jù): B(ehnxgz)B 解釋成 tsaedsaeezegexenehetsaedsae若將小寫字母與漢字建立下表所示的對(duì)應(yīng)關(guān)系,則魔王說的話是:"天上一只鵝地上一只鵝鵝追鵝趕鵝下鵝蛋鵝恨鵝天上一只鵝地上一只鵝". | t | d | s | a | e | z | g | x | n | h | | 天 | 地 | 上 | 一只| 鵝 | 追 | 趕 | 下 | 蛋 | 恨 |
上傳時(shí)間: 2014-12-02
上傳用戶:jkhjkh1982
We have a group of N items (represented by integers from 1 to N), and we know that there is some total order defined for these items. You may assume that no two elements will be equal (for all a, b: a<b or b<a). However, it is expensive to compare two items. Your task is to make a number of comparisons, and then output the sorted order. The cost of determining if a < b is given by the bth integer of element a of costs (space delimited), which is the same as the ath integer of element b. Naturally, you will be judged on the total cost of the comparisons you make before outputting the sorted order. If your order is incorrect, you will receive a 0. Otherwise, your score will be opt/cost, where opt is the best cost anyone has achieved and cost is the total cost of the comparisons you make (so your score for a test case will be between 0 and 1). Your score for the problem will simply be the sum of your scores for the individual test cases.
標(biāo)簽: represented integers group items
上傳時(shí)間: 2016-01-17
上傳用戶:jeffery
The XML Toolbox converts MATLAB data types (such as double, char, struct, complex, sparse, logical) of any level of nesting to XML format and vice versa. For example, >> project.name = MyProject >> project.id = 1234 >> project.param.a = 3.1415 >> project.param.b = 42 becomes with str=xml_format(project, off ) "<project> <name>MyProject</name> <id>1234</id> <param> <a>3.1415</a> <b>42</b> </param> </project>" On the other hand, if an XML string XStr is given, this can be converted easily to a MATLAB data type or structure V with the command V=xml_parse(XStr).
標(biāo)簽: converts Toolbox complex logical
上傳時(shí)間: 2016-02-12
上傳用戶:a673761058
請(qǐng)用星號(hào)(*)排列出下列的雙箭頭星號(hào)圖案,輸入資料檔e.txt中的第一行為箭頭的上下高度(必為奇數(shù)),第二行為圖案的總寬度
標(biāo)簽:
上傳時(shí)間: 2016-07-25
上傳用戶:love1314
臺(tái)灣地區(qū)民眾使用網(wǎng)路之情形,與使用寬頻上網(wǎng) 、無線上網(wǎng) 、行動(dòng)上網(wǎng) 之使用狀況與行為、臺(tái)灣地區(qū)偏遠(yuǎn)及非偏遠(yuǎn)地區(qū)其網(wǎng)路使用行為之差異;另外,也針對(duì)臺(tái)灣地區(qū)家庭,了解其使用網(wǎng)路與寬頻之狀況與行為
標(biāo)簽:
上傳時(shí)間: 2016-08-17
上傳用戶:songnanhua
使用C#程式語(yǔ)言開發(fā),並執(zhí)行於.NET Framework下;是研習(xí)「蟻拓尋優(yōu)法」不可或缺的軟體工具。系統(tǒng)使用ACO (Ant Colony Optimization)演算公式模擬螞蟻的覓食行徑抉擇。使用者可以設(shè)定費(fèi)洛蒙和食物氣味強(qiáng)度等相關(guān)參數(shù)以及動(dòng)態(tài)設(shè)定障礙物的位置和形狀,研習(xí)螞蟻覓食的最短路徑形成過程。研習(xí)各種參數(shù)設(shè)定對(duì)螞蟻覓食行為的影響,了解費(fèi)落蒙機(jī)制對(duì)蟻拓尋優(yōu)化法的影響。本系統(tǒng)可支援柔性計(jì)算教學(xué),研習(xí)蟻拓優(yōu)化法中人工螞蟻的隨機(jī)搜尋模式和啟發(fā)式法則設(shè)計(jì)原理。
標(biāo)簽: 程式
上傳時(shí)間: 2013-12-24
上傳用戶:anng
漢諾塔!!! Simulate the movement of the Towers of Hanoi puzzle Bonus is possible for using animation eg. if n = 2 A→B A→C B→C if n = 3 A→C A→B C→B A→C B→A B→C A→C
標(biāo)簽: the animation Simulate movement
上傳時(shí)間: 2017-02-11
上傳用戶:waizhang
將魔王的語(yǔ)言抽象為人類的語(yǔ)言:魔王語(yǔ)言由以下兩種規(guī)則由人的語(yǔ)言逐步抽象上去的:α-〉β1β2β3…βm ;θδ1δ2…-〉θδnθδn-1…θδ1 設(shè)大寫字母表示魔王的語(yǔ)言,小寫字母表示人的語(yǔ)言B-〉tAdA,A-〉sae,eg:B(ehnxgz)B解釋為tsaedsaeezegexenehetsaedsae對(duì)應(yīng)的話是:“天上一只鵝地上一只鵝鵝追鵝趕鵝下鵝蛋鵝恨鵝天上一只鵝地上一只鵝”。(t-天d-地s-上a-一只e-鵝z-追g-趕x-下n-蛋h-恨)
上傳時(shí)間: 2013-12-19
上傳用戶:aix008
本代碼為編碼開關(guān)代碼,編碼開關(guān)也就是數(shù)字音響中的 360度旋轉(zhuǎn)的數(shù)字音量以及顯示器上用的(單鍵飛梭開 關(guān))等類似鼠標(biāo)滾輪的手動(dòng)計(jì)數(shù)輸入設(shè)備。 我使用的編碼開關(guān)為5個(gè)引腳的,其中2個(gè)引腳為按下 轉(zhuǎn)輪開關(guān)(也就相當(dāng)于鼠標(biāo)中鍵)。另外3個(gè)引腳用來 檢測(cè)旋轉(zhuǎn)方向以及旋轉(zhuǎn)步數(shù)的檢測(cè)端。引腳分別為a,b,c b接地a,c分別接到P2.0和P2.1口并分別接兩個(gè)10K上拉 電阻,并且a,c需要分別對(duì)地接一個(gè)104的電容,否則 因?yàn)榫幋a開關(guān)的觸點(diǎn)抖動(dòng)會(huì)引起輕微誤動(dòng)作。本程序不 使用定時(shí)器,不占用中斷,不使用延時(shí)代碼,并對(duì)每個(gè) 細(xì)分步數(shù)進(jìn)行判斷,避免一切誤動(dòng)作,性能超級(jí)穩(wěn)定。 我使用的編碼器是APLS的EC11B可以參照附件的時(shí)序圖 編碼器控制流水燈最能說明問題,下面是以一段流水 燈來演示。
標(biāo)簽: 代碼 編碼開關(guān)
上傳時(shí)間: 2017-07-03
上傳用戶:gaojiao1999
計(jì)算矩陣連乘積 問題描述 在科學(xué)計(jì)算中經(jīng)常要計(jì)算矩陣的乘積。矩陣A和B可乘的條件是矩陣A的列數(shù)等于矩陣B的行數(shù)。若A是一個(gè)p×q的矩陣,B是一個(gè)q×r的矩陣,則其乘積C=AB是一個(gè)p×r的矩陣。
上傳時(shí)間: 2015-03-25
上傳用戶:yulg
蟲蟲下載站版權(quán)所有 京ICP備2021023401號(hào)-1