Advertisement
hopingsteam

Untitled

Apr 7th, 2020
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. void generatoare(unsigned int n)
  2. {
  3. int k = 0;
  4. for(int div = 2; div <= n / 2; div = div + 2)
  5. {
  6. int cat = n / div;
  7. if(((cat * div) + (div / cat)) == n)
  8. {
  9. cout << div << "-" << cat << " ";
  10. k++;
  11. }
  12. }
  13. if(n % 2 == 0 && (n / 2) % 2 == 0)
  14. {
  15. cout << n / 2 << "-" << 1 << " ";
  16. k++;
  17. }
  18. if(k == 0)
  19. cout << "nu exista";
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement