数字运算,判断一个数是否接近素数 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
《角度测量器》 用光电编码器测量角度,每个脉冲为0.72度。 测量范围:0.0~360.0度 为保证不错过脉冲,用timer1计数,在电平跳变中断里判断转动方向,尽量加快处理过程。 数据换算和数码管扫描显示在主循环中实现。 译码器用10米长5芯屏蔽线与数显器的两片74HC595连接。 MCU为12F629,使用内部4兆RC振荡和内部复位功能。
上传时间: 2015-06-18
上传用户:sclyutian
本程序为tcl程序,用于以ns2模拟ad hoc network. 本程序实作50个 nodes 在1000 * 1000公尺内随意移动的ad hoc network.
上传时间: 2014-01-27
上传用户:Thuan
串口采集数据,然后由网口发送出去,linux c编程
上传时间: 2013-12-07
上传用户:hopy
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
MPC860原理图,以及串口、网口、QMC等全部外设的初始化源代码,极力推荐。
上传时间: 2014-01-10
上传用户:天诚24
% [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
s3c2410的vxworks bsp,运行良好,有文件系统和串口,spi口驱动,可以支持网口下载
上传时间: 2015-07-16
上传用户:冇尾飞铊
对任何纯文本文件进行随机抽奖的功能,其中一等奖,二等奖,三 等奖最多可以抽取100名,鼓励奖最多可以抽取1000名。总抽奖数量为1300人。样本的 文本文件长度没有限制。
标签: 随机
上传时间: 2015-08-04
上传用户:kernaling