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

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

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

  • TMS320f2808_例程程序
    一些学习TI DSP2808 芯片程序的例程,包括定时器中断,格式文件,多频率正弦信号,SPI接口
    2022-09-01 10:45:03下载
    积分:1
  • querydef
    使用ODBC实现的一个动态RecordSet(Using ODBC to implement an dynamic recordset)
    2021-05-07 16:43:36下载
    积分:1
  • gt911
    本程序为完整的用GT911芯片设计的触摸屏程序,可以供开始设计触摸屏的一个很好的参考,值的收藏(This program is complete with the GT911 chip design touch screen program, you can begin to design a touch screen for a good reference value of the collection)
    2021-04-02 19:09:07下载
    积分:1
  • fdtdtianxian
    fdtd程序,线馈矩形微带天线的分析文档,其中包括两种模型的建立,有matlab和C++程序。(fdtd program, line fed rectangular microstrip antenna analysis documents, including the establishment of the two models, with matlab and C++ program.)
    2010-11-11 22:36:45下载
    积分:1
  • MyJob
    为了显示调试信息的方便,做了这个控件,用Message2Console函数向控件增加消息. 也可用SendMessage的方式向控件增加消息. 本MyBigJob只是为了测试这个控件. 这是我第三次上传这控件,改进了多个相同控件的兼容.(因为之前在响应函数里加了static) 这段代码是我学线程时做的. 线程方面学到的函数有:Sleep,WaitForSingleObject,SetEvent(To display debugging information easy to do this control, add a message to the control Message2Console function can also be used the the SendMessage way to add a message to the control. The MyBigJob just this is the third time I upload this control in order to test the controls. Improved more of the same control compatible (as before in the response function Riga static) this code I do learn thread. threading learned function: Sleep, WaitForSingleObject SetEvent)
    2012-10-01 14:48:48下载
    积分:1
  • Ant-TSP
    蚁群算法的TSP问题解决方法,对于蚁群算法的了解有很大的帮助(ant arithmatic TSP problem solution, it s helpful for you to understand ant arithmatic.)
    2014-07-30 17:11:35下载
    积分:1
  • MFCBandFilter
    一个用MFC写的滤波器源代码,代码结构非常精巧,可以参考 功能:1 固定带通滤波 2 可变带通滤波 3 噪声删除 4 输入输出误差计算 实现比较简单,由于使用了Microsoft Foundation classes,代码流程很简单,但是实现的功能比较充分 Filter.h:头文件,定义了CFilterApp 类 Filter.cpp:利用MFC的函数实现了CFilterApp Filter.rc:资源文件,包括对话框和图标的说明(use a filter to write MFC source code, code structure is very delicate, can be functional : a fixed band-pass filtering two variable bandpass filter to delete four 3 noise input and output error calculation is relatively simple to achieve. As the use of Microsoft Foundation classes, code process is simple, but to achieve the more fully functional Filter.h : The first document, CFilterApp definition of the category Filter.cpp : MFC function realized CFilterApp Filter.rc : resource files, including dialog box and the note icon)
    2006-12-04 17:13:56下载
    积分:1
  • EditTreeControl
    创建可编辑节点的树形控件EditTreeControlEditTreeControl.rar,很不错的vc源码,希望对大家有所帮助。(Creating an editable node tree control EditTreeControl EditTreeControl.rar, very good vc source code, we want to help.)
    2011-09-21 22:44:13下载
    积分:1
  • gpu最短距离
    随机生成5000乘客与50000出租车的距离,计算最短距离,并用gpu加速
    2023-02-21 10:00:03下载
    积分:1
  • Memory_distribution_Xiangjie
    程序内存分配方式详解:一个讲解内存分配的教程,word版本很详细值得学习(Memory distribution Xiangjie: a brief tutorial on memory allocation, word version is more worthy of study)
    2010-07-27 17:22:09下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载