数字运算,判断一个数是否接近素数 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
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
上传用户:变形金刚
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
针对基于光电传感器组寻迹的自动导引机器人,设计了传感器阵列的布置方式。根据此布置方式,提出了三个处理规则结合而成的轨迹识别算法。即使在导引线复杂的情况下,用此算法也能得出行进方向,控制机器人沿轨迹运动。甚至遇到干扰走错时,机器人也能自动纠错。
上传时间: 2014-11-01
上传用户:hfmm633
近二十年来,人脸跟踪与识别技术已经成为计算机视觉与模式识别的一个重要研究方向,在商业和安全部门有着广泛的应用。目前的研究工作主要集中在静态人脸识别等方面,但由于静态图像的获取在某些移动场合下的获取是不友善的,给研究工作带来了一定的困难。为了满足应用的需要,本文通过对人脸跟踪与人脸识别算法的综述及比较,系统地研究了基于人脸跟踪的动态人脸识别方法。
标签:
上传时间: 2013-12-11
上传用户:xlcky
用游标的方法实现对称差的计算,即 (A-B)+(B-A)
上传时间: 2016-05-23
上传用户:远远ssad
词法分析器 对输入一个函数,并对其分析main() { int a,b a = 10 b = a + 20 }
上传时间: 2013-12-20
上传用户:hfmm633
函数再现机构设计 试设计一曲柄摇杆机构,再现函数 要求: 输入构件的转角范围180°,输出构件摆角范围30°,即: 当输入构件从a转至a+90时,输出构件从b转至b+30 当输入构件从a+90转至a+180时,输出构件从b+30转至b
上传时间: 2013-12-17
上传用户:英雄
这个连接池是直接从JIVE中取出来的,进行了一下修改,使得连接参数直接在程序中设定而不是从属性文件中读取。 [b]用法:[/b] 先设定自己的连接参数,在DbConnectionDefaultPool.java文件的loadProperties方法中。注意你也需要设定连接池的log文件的存放位置。
上传时间: 2016-11-21
上传用户:TF2015
汉诺塔!!! Simulate the movement of the Towers of Hanoi puzzle Bonus is possible for using animation eg. if n = 2 A→B A→C B→C if n = 3 A→C A→B C→B A→C B→A B→C A→C
标签: the animation Simulate movement
上传时间: 2017-02-11
上传用户:waizhang