SHARE
TWEET

Untitled

a guest Nov 17th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6.     int n;
  7.     cin >> n;
  8.  
  9.     for(int i=2;i<=sqrt(n);i++){
  10.         while (n % i == 0)
  11.         {
  12.             cout << i << " ";
  13.             n /= i;
  14.         }
  15.     }
  16.     if ( n != 1) cout << n;
  17.  
  18.  
  19.     return 0;
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top