Function: Enter a positive integer that outputs all of its prime number factors in order from small to large (for example, a prime factor of 180 is 2 2 3 3 5)
Detailed Description:
Function Interface Description:
Public String GetResult (long Uldatainput)
Input parameters:
Long uldatainput: The positive integer entered
return value:
String
Input Description:
Enter a long integer
Output Description:
A factor that outputs all of its prime numbers in order from small to large, separated by a space
Input Example:
180
Output Example:
2 2 3) 3 5
1 //ConsoleApplication4.cpp: Defines the entry point of the console application. 2 //3 4#include"stdafx.h"5 6#include <iostream>7 8 using namespacestd;9 Ten intMainvoid) One { A Longvalue; - while(Cin >>value) - { the while(Value! =1) - { - for(inti =2; I <= value; i++) - { + if(value%i = =0) - { +Value/=i; Acout << i <<' '; at Break; - } - } - } - } - in return 0; -}
Prime number Factor