Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void generatoare(unsigned int n)
- {
- int k = 0;
- for(int div = 2; div <= n / 2; div = div + 2)
- {
- int cat = n / div;
- if(((cat * div) + (div / cat)) == n)
- {
- cout << div << "-" << cat << " ";
- k++;
- }
- }
- if(n % 2 == 0 && (n / 2) % 2 == 0)
- {
- cout << n / 2 << "-" << 1 << " ";
- k++;
- }
- if(k == 0)
- cout << "nu exista";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement