登录
首页 » C# » 将一个正整数分解质因数。例如:输入90,打印出90=2*3*3*5。 程序分析:对n进行分解质因数,应先找到一个最小的质数k,然后按下述步骤完成:...

将一个正整数分解质因数。例如:输入90,打印出90=2*3*3*5。 程序分析:对n进行分解质因数,应先找到一个最小的质数k,然后按下述步骤完成:...

于 2022-08-16 发布 文件大小:2.60 kB
0 101
下载积分: 2 下载次数: 1

代码说明:

将一个正整数分解质因数。例如:输入90,打印出90=2*3*3*5。 程序分析:对n进行分解质因数,应先找到一个最小的质数k,然后按下述步骤完成: (1)如果这个质数恰等于n,则说明分解质因数的过程已经结束,打印出即可。 (2)如果nk,但n能被k整除,则应打印出k的值,并用n除以k的商,作为新的正整数你n,  重复执行第一步。 (3)如果n不能被k整除,则用k+1作为k的值,重复执行第一步。 -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

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • stack
    栈采用顺序栈存储,该算法是将表达式转换成后缀表达式输出。(Stack sequential memory stack, the algorithm is to convert the expression into a postfix expression output.)
    2015-05-19 19:16:28下载
    积分:1
  • 单片机程序调试黑宝书
    说明:  单片机程序调试黑宝书,很好的书籍,适合入门。(Single-chip computer program debugging black book, a good book.)
    2020-06-19 09:20:02下载
    积分:1
  • 可控下雨产生反光波纹
    说明:  图形学作业,用opengl技术模拟了水波纹。(It's an app for computer graphics.)
    2021-01-03 23:38:32下载
    积分:1
  • 自创简易示波器
    说明:  简易示波器双通道,tim adc dma(Simple oscilloscope dual channel, Tim ADC DMA)
    2019-04-02 16:55:10下载
    积分:1
  • 禁止关闭操作系统C#源代码实例, 如何禁止关闭操作系统程序...
    禁止关闭操作系统C#源代码实例, 如何禁止关闭操作系统程序-the closure of the operating system C# source code examples, how to stop the closure of the operating system procedures
    2022-04-10 05:17:57下载
    积分:1
  • pi
    说明:  并行计算实验,多线程计算pi源代码,附有说明。(Parallel computing experiment, multithreaded to calculate pi source code annotated.)
    2012-08-30 23:28:45下载
    积分:1
  • Code
    TCP/ip GPRS DTU源码 工业GPRS无线传入接入方案 数据中心(TCP/ip GPRS DTU source industrial GPRS wireless incoming data center access solutions)
    2013-04-02 16:56:03下载
    积分:1
  • 60368809
    memcached资源demo(已调试通过)(Memcached Resource demo (Debug passed))
    2019-05-09 19:14:17下载
    积分:1
  • a-fast-digital-AGC
    一种快速数字AGC结构的分析与设计,希望对大家有帮助(Structural analysis and design of a fast digital AGC)
    2012-06-10 11:19:14下载
    积分:1
  • WeiQiClient
    围棋客户端代码,功能齐全好用。下棋 棋谱啥都有(Go client code, fully functional and easy to use. There is everything in chess and chess)
    2020-06-17 22:20:01下载
    积分:1
  • 696518资源总数
  • 105559会员总数
  • 1今日下载