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

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

于 2022-08-16 发布 文件大小:2.60 kB
0 161
下载积分: 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 个回复

  • TCPNetKitbox
    TCP网络调试程序 本程序可以用来进行TCP通信的调试,程序包含了TCP服务器和客户端两个部分。 TCP服务器可以在指定的端口进行监听,并同时最多处理100个连接。实时显示每个连接发送过来的数据,并且可以手工选择需要对哪个连接回送数据,或者是断开某个连接。 TCP客户端可以对某个IP(或者直接输入域名)的端口进行连接,实时显示已经连接的服务器发送的信息,可以手动输入需要发送到服务器的内容。 这个程序在对一些自己编写的服务器或者客户端的程序进行调试的时候比较有用。 大家在使用中有什么好的意见或者建议,欢迎发送邮件到ghsnc@163.com。 马丹(TCP network debugging procedures of this procedure can be used for TCP communications debugging, includes the TCP server and client in two parts. TCP server can be the designated port eavesdropping, and at the same time deal with a maximum of 100 links. Real-time display over each link this data, as well as the need to manually choose which link to send data, or disconnect a link. TCP client can be on a certain IP (or domain name directly input) port for connection, real-time display is already connected to the server to send messages manually input can be sent to the server needs of the content. In the process of the preparation of some of their server or client procedure debugging time more useful. We use any good ideas or suggestions, please send an email to ghsnc@163.com. Martin)
    2007-04-14 21:48:20下载
    积分:1
  • 测脉宽
    测脉宽,基于STC15W单片机的测试要在1.3管脚加一个脉冲然后通过OLED 屏幕显示(Pulse width measurement)
    2020-06-19 15:00:01下载
    积分:1
  • GB-T15770-1995
    广播数据系统技术规范(中国RDS相关技术规范)(Radio Data System Specification (China RDS-related technical specifications))
    2010-08-04 11:23:40下载
    积分:1
  • CSCommTest
    说明:  串口驱动程序,在界面上能发送接收数据,主要是参照网上的教程实现的,代码能运行通过,是一个界面程序(Serial port driver, the interface can send receive data, mainly by reference to the realization of online tutorials, and code to run through, is an interface program)
    2008-12-08 09:41:19下载
    积分:1
  • Example_2833xAdcToDMA
    说明:  使用 DMA 实现DSP 28335 的多路AD采集 。(Multi-channel AD acquisition of DSP 28335 is realized by DMA.)
    2019-04-12 18:55:22下载
    积分:1
  • treeview
    说明:  MFC树状结构简单示例 dialog和treeview(TreeView,dialog and treeview)
    2010-04-19 17:46:25下载
    积分:1
  • rsa
    Some example methods to evaluate and break simple RSA
    2011-02-06 16:51:56下载
    积分:1
  • Root_Loci
    根轨迹文件 多刚体动力学 方程 根分布 稳定分析 (Root locus document root distribution multibody dynamics equations stability analysis)
    2014-09-21 21:13:28下载
    积分:1
  • Advanced-C-language
    C语言进阶资料,一共分为八讲,提高的好资料。(Advanced C language data, a total of eight, good data to improve the.)
    2013-10-17 19:04:15下载
    积分:1
  • 将XML读入到TreeView里,可以是多从显示的树结构
    将XML读入到TreeView里,可以是多从显示的树结构-Reading XML into the TreeView, the can is from the tree structure
    2022-01-25 21:36:39下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载