數字運算,判斷一個數是否接近素數 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
這里有2組圖,“1000.0.05”這一組是運行結果比較好的一組圖,但是當時修改了時間間隔而沒有改坐標說明,所以db1000.0.05.fig這幅圖的坐標說明后來做了人工改正(應該是“time(0~250ms分成5000組,步長0.05ms”)。
標簽:
上傳時間: 2015-06-01
上傳用戶:haohaoxuexi
本程序為tcl程序,用于以ns2模擬ad hoc network. 本程序實作50個 nodes 在1000 * 1000公尺內隨意移動的ad hoc network.
上傳時間: 2014-01-27
上傳用戶:Thuan
Features • Compatible with MCS-51® Products • 8K Bytes of In-System Programmable (ISP) Flash Memory – Endurance: 1000 Write/Erase Cycles • 4.0V to 5.5V Operating Range • Fully Static Operation: 0 Hz to 33 MHz • Three-level Program Memory Lock • 256 x 8-bit Internal RAM • 32 Programmable I/O Lines • Three 16-bit Timer/Counters • Eight Interrupt Sources • Full Duplex UART Serial Channel • Low-power Idle and Power-down Modes • Interrupt Recovery from Power-down Mode • Watchdog Timer • Dual Data Pointer • Power-off Flag
標簽: 8226 Programmable Compatible In-System
上傳時間: 2015-06-27
上傳用戶:dianxin61
% [BestPop,Trace]=fmaxga(FUN,LB,UB,eranum,popsize,pcross,pmutation) % Finds a maximum of a function of several variables. % fmaxga solves problems of the form: % max F(X) subject to: LB <= X <= UB % BestPop--------最優的群體即為最優的染色體群 % Trace----------最佳染色體所對應的目標函數值 % FUN------------目標函數 % LB-------------自變量下限 % UB-------------自變量上限 % eranum---------種群的代數,取100--1000(默認1000) % popsize--------每一代種群的規模;此可取50--100(默認50) % pcross---------交叉的概率,此概率一般取0.5--0.85之間較好(默認0.8) % pmutation------變異的概率,該概率一般取0.05-0.2左右較好(默認0.1) % options--------1×2矩陣,options(1)=0二進制編碼(默認0),option(1)~=0十進制編碼,option(2)設定求解精度(默認1e-4)
標簽: pmutation BestPop popsize maximum
上傳時間: 2015-07-16
上傳用戶:Altman
對任何純文本文件進行隨機抽獎的功能,其中一等獎,二等獎,三 等獎最多可以抽取100名,鼓勵獎最多可以抽取1000名。總抽獎數量為1300人。樣本的 文本文件長度沒有限制。
標簽: 隨機
上傳時間: 2015-08-04
上傳用戶:kernaling
操作系統是Windows 98,開發平臺:VC。可以通過CAN_EPP的板子對節點板的AD等模塊的數據進行解碼,直接顯示模擬量,也可以對通用模塊上傳的數據直接顯示,以及按照不同的方式(可以多幀發送,改變發送周期)發送數據幀。軟件還支持在線監視模塊上的控制器芯片(SJA 1000)的各寄存器的工作狀態,以便于系統調試。每個功能界面上有相應的幫助信息。
上傳時間: 2014-06-07
上傳用戶:refent
隨著人們的生活水平的日益提高,洗衣機的使用也越來越普及,目前全國的洗衣機的年產量已超過1000萬臺。洗衣機的分類較多,根據不同的角度大致可分如下幾類: 洗衣機從不同洗衣的原理來說可分為波輪洗衣機、滾筒洗衣機、以及攪拌式洗衣機。 洗衣機從結構上又可分為:單缸和雙缸洗衣機; 洗衣機從水流方式上又可分為:瀑布水流、手搓水流、懸浮水流等; 洗衣機從電機的驅動方式上又可分為:間接驅動和直接驅動(DD型洗衣機); 從洗衣機的電機的驅動電源的不同可分為:普通洗衣機和變頻洗衣機,其中變頻洗衣機又可分為:直流變頻洗衣機和交流變頻洗衣機; 從洗衣機的顯示方式來分有:LED燈顯示、數碼管顯示、LCD顯示、以及VFD顯示。 目前在國內波輪洗衣機占洗衣機用量的大部分,滾筒洗衣機和攪拌式洗衣機在國內很少,主要在歐美的家庭大量使用。但近幾年滾筒洗衣機洗衣機在國內的市場呈快速增長。
標簽: 水平
上傳時間: 2014-01-16
上傳用戶:banyou
時間復雜度為O(ElogV)的Dijkrastra算法的實現,解決城市道路網的最短路徑問題,可以計算1000×1000個節點。
標簽: Dijkrastra ElogV 復雜度 算法
上傳時間: 2015-09-23
上傳用戶:tzl1975
MATLAB implementation of SPIHT (without Arithmatic coding stage). % Performance evaluation : this toolbox VS. SPIHT % Test image: lena512.raw % bpp SPIHT(dB) This code(dB) % 0.1000 29.8107 29.3202 % 0.2000 32.7202 32.2514 % 0.3000 34.5479 34.0331 % 0.4000 35.8422 35.4857 % 0.5000 36.8623 36.5939 % 0.6000 37.6650 37.3759 % 0.7000 38.2581 38.0491 % 0.8000 38.9390 38.7058 % 0.9000 39.5218 39.3437
標簽: implementation Performance Arithmatic evaluation
上傳時間: 2013-12-08
上傳用戶:huannan88