数字运算,判断一个数是否接近素数 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