1 #include <iostream> 2 using namespace std; 3 4 void getResult(long int input) 5 { 6 for (int i=2;i<=input;i++) 7 { 8 while((0==input%i)&&input!=0) 9 { 10 cout<<i<<" "; 11 input=input/i; 12 } 13 } 14 15 } 16 17 int main() 18 { 19 int a; 20 cin>>a; 21 getResult(a); 22 return 0; 23 }