大衆點評筆試算法之質因數分解

將一個正整數分解質因數。例如:輸入90,打印出90=2*3*3*5。 代碼爲: // 質因數.cpp : 定義控制檯應用程序的入口點。 // #include "stdafx.h" #include<cmath> #include<cstdlib> #include<iostream> using namespace std; void Analyse(int n) { //打印出 int
相關文章
相關標籤/搜索