文件名称:zhishu-fenjie
-
所属分类:
- 标签属性:
- 上传时间:2014-03-19
-
文件大小:790byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
将一个正整数分解质因数。例如:输入90,打印出90=2*3*3*5。
程序分析:对n进行分解质因数,应先找到一个最小的质数k,然后按下述步骤完成:
(1)如果这个质数恰等于n,则说明分解质因数的过程已经结束,打印出即可。
(2)如果n <> k,但n能被k整除,则应打印出k的值,并用n除以k的商,作为新的正整数你,重复执行第一步。
(3)如果n不能被k整除,则用k+1作为k的值,重复执行第一步。
-The prime factorization of a positive integer. For example: Enter 90, print out 90 = 2* 3* 3* 5. Program analysis: the decomposition n prime factors, you should first find a smallest prime number k, then complete the following steps: (1) if the prime exactly equal to n, then the prime factor decomposition process has been completed, you can print out . (2) If n < > k, k but can be divisible by n, the value of k should be printed, and the quotient k divided by n, a positive integer as a new you repeat the first step. (3) If n is not divisible by k, the value of k is used as k+1 Repeat the first step.
程序分析:对n进行分解质因数,应先找到一个最小的质数k,然后按下述步骤完成:
(1)如果这个质数恰等于n,则说明分解质因数的过程已经结束,打印出即可。
(2)如果n <> k,但n能被k整除,则应打印出k的值,并用n除以k的商,作为新的正整数你,重复执行第一步。
(3)如果n不能被k整除,则用k+1作为k的值,重复执行第一步。
-The prime factorization of a positive integer. For example: Enter 90, print out 90 = 2* 3* 3* 5. Program analysis: the decomposition n prime factors, you should first find a smallest prime number k, then complete the following steps: (1) if the prime exactly equal to n, then the prime factor decomposition process has been completed, you can print out . (2) If n < > k, k but can be divisible by n, the value of k should be printed, and the quotient k divided by n, a positive integer as a new you repeat the first step. (3) If n is not divisible by k, the value of k is used as k+1 Repeat the first step.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
zhishu fenjie.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.