数字运算,判断一个数是否接近素数 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
本设计以ATMEL公司生产的AT90S8515作为控制核心,实现输出电流的数字控制,巧妙地利用4通道8位D/A转换芯MAX505转换芯片来完成16位的转换精度,D/A转换芯片输出的电压量经过一个压流变换电路变换成电流量的输出。再通过12位A/D转换芯片MAX197实现输出数据的反馈采集,形成输出电流的闭环控制,以此来达到较高的控制精度。
上传时间: 2015-05-29
上传用户:7676777
源代码\用动态规划算法计算序列关系个数 用关系"<"和"="将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
c语言版的多项式曲线拟合。 用最小二乘法进行曲线拟合. 用p-1 次多项式进行拟合,p<= 10 x,y 的第0个域x[0],y[0],没有用,有效数据从x[1],y[1] 开始 nNodeNum,有效数据节点的个数。 b,为输出的多项式系数,b[i] 为b[i-1]次项。b[0],没有用。 b,有10个元素ok。
上传时间: 2014-01-12
上传用户:变形金刚
进程调度算法有FIFO,优先数调度算法,时间片轮转调度算法,分级调度算法
上传时间: 2013-12-28
上传用户:cccole0605
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
AVR单片机应用设计.pdf 本书以AT90S8535单片机为主线讲述AVR单片机。AT90S8535单片机是AVR单片机中内部接口丰富、功能比较全、性能价格比高的品种。 本书共分16章。第1章,单片机概述;第2章,8535单片机系统结构概况;第3章,AVR单片机指令系统;第4章,定点数运算程序设计及数制转换;第5章,浮点数运算程序设计;第6章,8535单片机 EEPROM读/写访问;第7章,8535单片机I/O端口及其应用;第8章,中断系统及应用;第9章,8535单片机定时器/计数器及其应用;第10章,8535单片机模拟量输入接口;第11章,AVR单片机串行接口及应用;第12章,AVR单片机存储器编程;第13章,AVR的C语言IccAVR及应用;第14章,AVR单片机开发工具及应用;第15章,AVR单片机的最新发展;第16章,整机设计中几个问题的处理方法。书中所举硬件设计、软件设计实例均经实验通过。
上传时间: 2014-06-11
上传用户:shinesyh
数字信号处理实践方法,从一到三囊括了数字信号处理的模数变换、DFT变换、Z变换、滤波器设计等
上传时间: 2014-02-10
上传用户:cc1915
数字信号处理实践方法,从一到三囊括了数字信号处理的模数变换、DFT变换、Z变换、滤波器设计等
上传时间: 2013-12-10
上传用户:啊飒飒大师的
数字信号处理实践方法,从一到三囊括了数字信号处理的模数变换、DFT变换、Z变换、滤波器设计等
上传时间: 2013-12-23
上传用户:bruce