如果整數(shù)A的全部因子(包括1,不包括A本身)之和等于B;且整數(shù)B的全部因子(包括1,不包括B本身)之和等于A,則將整數(shù)A和B稱為親密數(shù)。求3000以內(nèi)的全部親密數(shù)。 *題目分析與算法設(shè)計 按照親密數(shù)定義,要判斷數(shù)a是否有親密數(shù),只要計算出a的全部因子的累加和為b,再計算b的全部因子的累加和為n,若n等于a則可判定a和b是親密數(shù)。計算數(shù)a的各因子的算法: 用a依次對i(i=1~a/2)進行模運算,若模運算結(jié)果等于0,則i為a的一個因子;否則i就不是a的因子。 *
標(biāo)簽: 整數(shù)
上傳時間: 2015-04-24
上傳用戶:金宜
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男一枚
by Randal L. Schwartz and Tom Phoenix ISBN 0-596-00132-0 Third Edition, published July 2001. (See the catalog page for this book.) the text of Learning Perl, 3rd Edition. Table of Contents Copyright Page Preface Chapter 1: Introduction Chapter 2: Scalar Data Chapter 3: Lists and Arrays Chapter 4: Subroutines Chapter 5: Hashes Chapter 6: I/O Basics Chapter 7: Concepts of Regular Expressions Chapter 8: More About Regular Expressions Chapter 9: Using Regular Expressions Chapter 10: More Control Structures Chapter 11: Filehandles and File Tests Chapter 12: Directory Operations Chapter 13: Manipulating Files and Directories Chapter 14: Process Management Chapter 15: Strings and Sorting Chapter 16: Simple Databases Chapter 17: Some Advanced Perl Techniques Appendix A: Exercise Answers Appendix B: Beyond the Llama Index Colophon
標(biāo)簽: L. published Schwartz Edition
上傳時間: 2014-11-29
上傳用戶:kr770906
by Randal L. Schwartz and Tom Phoenix ISBN 0-596-00132-0 Third Edition, published July 2001. (See the catalog page for this book.) Learning Perl, 3rd Edition. Table of Contents Copyright Page Preface Chapter 1: Introduction Chapter 2: Scalar Data Chapter 3: Lists and Arrays Chapter 4: Subroutines Chapter 5: Hashes Chapter 6: I/O Basics Chapter 7: Concepts of Regular Expressions Chapter 8: More About Regular Expressions Chapter 9: Using Regular Expressions Chapter 10: More Control Structures Chapter 11: Filehandles and File Tests Chapter 12: Directory Operations Chapter 13: Manipulating Files and Directories Chapter 14: Process Management Chapter 15: Strings and Sorting Chapter 16: Simple Databases Chapter 17: Some Advanced Perl Techniques Appendix A: Exercise Answers Appendix B: Beyond the Llama Index Colophon
標(biāo)簽: L. published Schwartz Edition
上傳時間: 2015-09-03
上傳用戶:lifangyuan12
上下文無關(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
三相步進電機的三相六拍工作方式,正轉(zhuǎn)的繞組通電順序:A、AB、B、BC、C、CA、A,反轉(zhuǎn)的通電順序:A、AC、C、CB、B、BA、B、A。 由于步進電機轉(zhuǎn)子有一定的慣性以及所帶負(fù)載的慣性,故步進電機的工作過程中不能及時的啟動和停止,在啟動時應(yīng)慢慢的加速到預(yù)定速度,在停止前應(yīng)逐漸減速到停止,否則,將產(chǎn)生失步現(xiàn)象。 步進電機的控制問題可總結(jié)為兩點: 1、產(chǎn)生工作方式需要的時序脈沖; 2、控制步進電機的速度,使它始終遵循加速、勻速、減速的規(guī)律工作。
上傳時間: 2015-12-01
上傳用戶:685
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
上傳時間: 2016-01-17
上傳用戶:jeffery
加密程序源代碼* A 變成 C,B 變成 D,a 變成 c,b 變成 d,Y 變成 A, * z 變成 b,以此類推。非字母字符不變。
上傳時間: 2013-12-28
上傳用戶:stvnash
C程序設(shè)計語言于1978年出了第一版,此后,計算機世界經(jīng)歷了一場革命,C語言也有了合理的變化。1988年美國國家標(biāo)準(zhǔn)學(xué)會就C語言的主義制訂出了ANSI C標(biāo)準(zhǔn)。本書第二版就是按這個標(biāo)準(zhǔn)來描述C語言的。全書八章,分別分:1.指導(dǎo)性緒論;2.數(shù)據(jù)類型、運算符與表達(dá)式;3.控制流;4.函數(shù)與結(jié)構(gòu);5.指針與數(shù)組;6.結(jié)構(gòu);7.輸入輸出;8.UNIX系統(tǒng)界面。書后附錄為:A.參考手冊;B.標(biāo)準(zhǔn)庫;C.語言
標(biāo)簽: 1978 C程序設(shè)計 語言
上傳時間: 2014-01-10
上傳用戶:tuilp1a
蟲蟲下載站版權(quán)所有 京ICP備2021023401號-1