文件名称:fenjieyinshu
介绍说明--下载内容均来自于网络,请自行研究使用
题目:将一个正整数分解质因数。例如:输入90,打印出90=2*3*3*5。
程序分析:对n进行分解质因数,应先找到一个最小的质数k,然后按下述步骤完成:
(1)如果这个质数恰等于n,则说明分解质因数的过程已经结束,打印出即可。
(2)如果n<>k,但n能被k整除,则应打印出k的值,并用n除以k的商,作为新的正整数你n,
重复执行第一步。
(3)如果n不能被k整除,则用k+1作为k的值,重复执行第一步。 -Title: will be a positive integer decomposition of the quality factor. For example: enter 90, print out 90 = 2* 3* 3* 5. Program analysis: the decomposition of n quality factor, should be to find a smallest prime number k, then complete the following steps: (1) If the prime number exactly equal to n, is illustrated in the process of decomposition of the quality factor has come to an end, you can print out . (2) If n <> k, but n can be divisible by k, it should print out the value of k, and k of n divided by the number of providers, as a new positive integer you n, repeat the first step. (3) If n can not be divisible by k, then use k+ 1 as k values, repeat the first step.
程序分析:对n进行分解质因数,应先找到一个最小的质数k,然后按下述步骤完成:
(1)如果这个质数恰等于n,则说明分解质因数的过程已经结束,打印出即可。
(2)如果n<>k,但n能被k整除,则应打印出k的值,并用n除以k的商,作为新的正整数你n,
重复执行第一步。
(3)如果n不能被k整除,则用k+1作为k的值,重复执行第一步。 -Title: will be a positive integer decomposition of the quality factor. For example: enter 90, print out 90 = 2* 3* 3* 5. Program analysis: the decomposition of n quality factor, should be to find a smallest prime number k, then complete the following steps: (1) If the prime number exactly equal to n, is illustrated in the process of decomposition of the quality factor has come to an end, you can print out . (2) If n <> k, but n can be divisible by k, it should print out the value of k, and k of n divided by the number of providers, as a new positive integer you n, repeat the first step. (3) If n can not be divisible by k, then use k+ 1 as k values, repeat the first step.
相关搜索: 分解质因数
(系统自动生成,下载前可以参看下载内容)
下载文件列表
fenjieyinshu.c