fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int N;
  6. cin >> N;
  7. int temp=0;
  8. while(temp==0){
  9. int check=0;
  10. for(int i=2;i<=sqrt(N);i++){
  11. if(N%i==0){
  12. check=1;
  13. cout << i << ' ';
  14. N/=i;
  15. break;
  16. }
  17. }
  18. if(check==0){
  19. cout << N << '\n';
  20. temp=1;
  21. }
  22. }
  23. }
Success #stdin #stdout 0.01s 5460KB
stdin
19
stdout
19