数字运算,判断一个数是否接近素数 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
一个比较完整的pci卡的驱动程序,可以实现数据的采集与传输。并进行系统控制。
上传时间: 2013-12-05
上传用户:xmsmh
源代码\用动态规划算法计算序列关系个数 用关系"<"和"="将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
操作系统是Windows 98,开发平台:VC。可以通过CAN_EPP的板子对节点板的AD等模块的数据进行解码,直接显示模拟量,也可以对通用模块上传的数据直接显示,以及按照不同的方式(可以多帧发送,改变发送周期)发送数据帧。软件还支持在线监视模块上的控制器芯片(SJA 1000)的各寄存器的工作状态,以便于系统调试。每个功能界面上有相应的帮助信息。
上传时间: 2014-06-07
上传用户:refent
自己编的用于ENVI,g856,CZM-3数据预处理软件,不是很好用就是了
标签: ENVI
上传时间: 2015-09-13
上传用户:牧羊人8920
这篇报告介绍了关于PIC单片机原理与应用。主要有以下几方面内容:1 利用PIC单片机的PC计数器及实时计数器计数或计时,利用LED数码管显示数据。 2.利用PIC单片机进行各种信号、数据的采集。 3.利用单片机的控制功能实现控制。 4.了解其硬件上各引脚输入输出口,充分掌握其各个指令和基础编程,以及一些简单的应用。 5.利用EEPROM实现单片机的数据掉电保存及利用I2C模式进行通讯。
上传时间: 2014-01-01
上传用户:jiahao131
VB实现的串口通信操作界面,可以进行数据的采集,画实时曲线
上传时间: 2014-01-15
上传用户:zgu489
使用DSP的DM642中EDMA初始化,用来做语音数据的采集和存储。
上传时间: 2014-01-19
上传用户:dragonhaixm
使用DSP的DM642中EDMA中断服务程序,用来做语音数据的采集和存储。
上传时间: 2013-12-19
上传用户:zhengzg
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