RSA算法 :首先, 找出三個數, p, q, r, 其中 p, q 是兩個相異的質數, r 是與 (p-1)(q-1) 互質的數...... p, q, r 這三個數便是 person_key,接著, 找出 m, 使得 r^m == 1 mod (p-1)(q-1)..... 這個 m 一定存在, 因為 r 與 (p-1)(q-1) 互質, 用輾轉相除法就可以得到了..... 再來, 計算 n = pq....... m, n 這兩個數便是 public_key ,編碼過程是, 若資料為 a, 將其看成是一個大整數, 假設 a < n.... 如果 a >= n 的話, 就將 a 表成 s 進位 (s
標簽: person_key RSA 算法
上傳時間: 2013-12-14
上傳用戶:zhuyibin
數字運算,判斷一個數是否接近素數 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
迄今為止,本書已介紹了可在Microsoft Wi n d o w s操作系統中使用的全部網絡A P I函數。 利用這些函數,我們的應用程序可通過網絡,建立與其他程序的通信聯系。在那些討論中, 我們在很大程度上將重點放在七層O S I模型的應用層和表示層上面
標簽:
上傳時間: 2015-07-08
上傳用戶:royzhangsz
上下文無關文法(Context-Free Grammar, CFG)是一個4元組G=(V, T, S, P),其中,V和T是不相交的有限集,S∈V,P是一組有限的產生式規則集,形如A→α,其中A∈V,且α∈(V∪T)*。V的元素稱為非終結符,T的元素稱為終結符,S是一個特殊的非終結符,稱為文法開始符。 設G=(V, T, S, P)是一個CFG,則G產生的語言是所有可由G產生的字符串組成的集合,即L(G)={x∈T* | Sx}。一個語言L是上下文無關語言(Context-Free Language, CFL),當且僅當存在一個CFG G,使得L=L(G)。 *⇒ 例如,設文法G:S→AB A→aA|a B→bB|b 則L(G)={a^nb^m | n,m>=1} 其中非終結符都是大寫字母,開始符都是S,終結符都是小寫字母。
標簽: Context-Free Grammar CFG
上傳時間: 2013-12-10
上傳用戶:gaojiao1999
struts的詳細說明,是struts的經典經驗集合,對于做web開發的技術人員來說恨合適d o dio 哦!感覺寫的恨不錯就發上來了!
標簽: struts
上傳時間: 2016-01-01
上傳用戶:懶龍1988
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.
標簽: represented integers group items
上傳時間: 2016-01-17
上傳用戶:jeffery
本設計實際上是將被測模擬量轉換為數字量,并進行實時數字顯示,主要由以下幾部分構成:量程轉換電路、AC-DC轉換電路、3位半A/D轉換單元電路、基準電源單元電路、譯碼驅動單元以及數碼管顯示單元。其中A/D轉換器選用三位半MC14433,基準電源選用MC1403,譯碼驅動器則MC14511,另加四個共陰極LED發光數碼管。
上傳時間: 2013-12-24
上傳用戶:thinode
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).
標簽: converts Toolbox complex logical
上傳時間: 2016-02-12
上傳用戶:a673761058
modem編程 本地機使用ATDT命令撥號,遠程機設為自動響應方式,即可進入聯機方式, 進行終端通信。 在聯機方式下,按PageUp鍵上載文件,按PageDn鍵下載文件,Ctrl-O呼出主菜單,退出聯機方式使用Ctrl-D鍵。退出終端仿真器使用EXIT命令。 主程序使用C語言編寫。使用早期的C編譯器可以進行編譯。終端方式為VT100.
上傳時間: 2014-01-22
上傳用戶:xz85592677
程序說明 本地機使用ATDT命令撥號,遠程機設為自動響應方式,即可進入聯機方式, 進行終端通信。 在聯機方式下,按PageUp鍵上載文件,按PageDn鍵下載文件,Ctrl-O呼出主菜單,退出聯機方式使用Ctrl-D鍵。退出終端仿真器使用EXIT命令。 主程序使用TC編寫。終端方式為VT1
上傳時間: 2016-04-20
上傳用戶:lnnn30