SHARE
TWEET

Untitled

a guest Jan 19th, 2020 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void DescFactPrimi (int n);
  5.  
  6. int main()
  7. {
  8.     int n;
  9.     cin >> n;
  10.    
  11.     DescFactPrimi (n);
  12.    
  13.     return 0;
  14. }
  15.  
  16. void DescFactPrimi(int n)
  17. {
  18.    
  19.     int d = 2;
  20.    
  21.     while (d <= n)
  22.     {
  23.         while (n % d == 0)
  24.         {
  25.             cout << d << ' ';
  26.             n /= d;
  27.         }
  28.        
  29.         d++;
  30.     }
  31. }
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