文件名称:亲密数
-
所属分类:
- 标签属性:
- 上传时间:2008-10-13
-
文件大小:1023byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
如果整数A的全部因子(包括1,不包括A本身)之和等于B;且整数B的全部因子(包括1,不包括B本身)之和等于A,则将整数A和B称为亲密数。求3000以内的全部亲密数。
*题目分析与算法设计
按照亲密数定义,要判断数a是否有亲密数,只要计算出a的全部因子的累加和为b,再计算b的全部因子的累加和为n,若n等于a则可判定a和b是亲密数。计算数a的各因子的算法:
用a依次对i(i=1~a/2)进行模运算,若模运算结果等于0,则i为a的一个因子;否则i就不是a的因子。
*-If all integral factor (including one, including the A itself) the sum equivalent to B; But all integral factor B (1, B itself) is the sum of A, will be rounded A and B as a few intimate. For all of 3000 within a few intimate. * Subject algorithm design and analysis in accordance with the closest definition, in determining whether there are a few close a number calculated as a factor in all of the cumulative and b, b calculate all the factors and the accumulation of n, n if convicted could mean a and b are a few intimate. Calculations of a factor in the algorithm : a right turn i (i = 1 ~ a / 2) modulo, if modulo results equal to 0, i for one of a factor; I would otherwise not a factor. *
*题目分析与算法设计
按照亲密数定义,要判断数a是否有亲密数,只要计算出a的全部因子的累加和为b,再计算b的全部因子的累加和为n,若n等于a则可判定a和b是亲密数。计算数a的各因子的算法:
用a依次对i(i=1~a/2)进行模运算,若模运算结果等于0,则i为a的一个因子;否则i就不是a的因子。
*-If all integral factor (including one, including the A itself) the sum equivalent to B; But all integral factor B (1, B itself) is the sum of A, will be rounded A and B as a few intimate. For all of 3000 within a few intimate. * Subject algorithm design and analysis in accordance with the closest definition, in determining whether there are a few close a number calculated as a factor in all of the cumulative and b, b calculate all the factors and the accumulation of n, n if convicted could mean a and b are a few intimate. Calculations of a factor in the algorithm : a right turn i (i = 1 ~ a / 2) modulo, if modulo results equal to 0, i for one of a factor; I would otherwise not a factor. *
(系统自动生成,下载前可以参看下载内容)
下载文件列表
亲密数.txt
www.dssz.com.txt
www.dssz.com.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.