數字運算,判斷一個數是否接近素數 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
源代碼\用動態規劃算法計算序列關系個數 用關系"<"和"="將3個數a,b,c依次序排列時,有13種不同的序列關系: a=b=c,a=b<c,a<b=v,a<b<c,a<c<b a=c<b,b<a=c,b<a<c,b<c<a,b=c<a c<a=b,c<a<b,c<b<a 若要將n個數依序列,設計一個動態規劃算法,計算出有多少種不同的序列關系, 要求算法只占用O(n),只耗時O(n*n).
上傳時間: 2013-12-26
上傳用戶:siguazgb
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
漢諾塔!!! 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
標簽: the animation Simulate movement
上傳時間: 2017-02-11
上傳用戶:waizhang
專輯類-實用電子技術專輯-385冊-3.609G jk-b交通信號控制機原理圖-1.3M.zip
上傳時間: 2013-08-02
上傳用戶:zhf1234
用匯編編寫的河內塔程序 將第一柱a上n-1個盤借助第二柱c移到第三柱b 把a上剩下的一個盤移到c 將n-1個盤從b借助a移到第三柱c 這三步是圖示河內塔的根本方法 功能一:自己動手移動河內塔 先按左右鍵選擇要移的盤,按箭頭上鍵確定 再按左右鍵移到要的盤 如此,再根據河內塔的規則確定較好的次數step2 功能二:圖示河內塔移動過程 根據河內塔的基本方法,確定圖象,按任意鍵選下一步,(開始時輸入level)
上傳時間: 2015-01-10
上傳用戶:chenbhdt
二: 普通計算器的設計說明: 1 普通計算器的主要功能(普通計算與逆波蘭計算): 1.1主要功能: 包括 a普通加減乘除運算及帶括號的運算 b各類三角與反三角運算(可實現角度與弧度的切換) c邏輯運算, d階乘與分解質因數等 e各種復雜物理常數的記憶功能 f對運算過程的中間變量及上一次運算結果的儲存. G 定積分計算器(只要輸入表達式以及上下限就能將積分結果輸出) H 可編程計算器(只要輸入帶變量的表達式后,再輸入相應的變量的值就能得到相應的結果) I 二進制及八進制的計算器 j十六進制轉化為十進制的功能。 *k (附帶各種進制間的轉化器)。 L幫助與階乘等附屬功能
上傳時間: 2013-11-26
上傳用戶:yzy6007
1、本系統采用B/S架構,是學校智能辦公系統的一部分,菜單中的“用戶管理”、“權限管理”、“菜單管理”、“幫助主題”已集成在辦公系統之中,因此本系統不提供這幾項功能。 2、本系統采用集中管理、分工合作的方式,將用戶分為五個級別,每個級別的用戶只能使用相應的功能,因此,能公平、公正、公開地考評各位教師的教學質量。 3、支持多人同時操作和遠程操作,大大縮短數據錄入時間。 安裝和使用注意事項: 1、將壓縮文件解壓到IIS目錄后,運行cjcl目錄下的reg.bat。 2、系統內置五個用戶:系統管理、學校領導、成績錄入、班主任、一般用戶,其中前四個用戶的密碼均為1,而一般用戶在登錄頁面只需點提交,一般用戶只提供查詢功能。 3、使用前先由學校領導創建新任務,錄入學校信息、教師信息、班信息等,再由班主任錄入學生信息,最后由成績錄入員錄入學生成績。 4、在數據庫中的user表中更改或增加用戶,在jbqx表中更改每個級別的權限。 如有建議或疑問請與作者聯系。
標簽: 架構
上傳時間: 2015-03-11
上傳用戶:qlpqlq
注塑機生產過程的微機控制系統設計本系統設計是通過8255A并行端口A、B傳輸數據控制12個LED發光二級管的亮滅來模擬控制兩臺注塑機的生產過程。其中端口A和B分別對應1號和2號注塑機,每一個LED代表一個工序。編程語言采用BORLAND C++語言。
上傳時間: 2013-12-25
上傳用戶:葉山豪
Haskell 中文教程1-3章(flw譯) 純粹的函數型編程語言。以著名邏輯學家 Haskell B. Curry 的名字命名。 最初的目的是想要設計出滿足下面這些要求的語言: 1,它必須能夠適合教學、研究、應用開發,包括一些大系統的構造。 2,它必須能夠使用形式語言來準確描述。 3,它必須是自由免費的,任何人只要愿意都可以獲取、使用和再次發布它。 4,它必須建立在大家一致認可的基礎上。 5,它應該能夠消除目前的函數型編程語言的差異。
上傳時間: 2014-01-10
上傳用戶:685