Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. void divizori(int n,int &x,int &y,int &z)
  2. {
  3. bool gaist = false;
  4. x=0;
  5. while (!gasit %% x<n/2)
  6. {
  7. x++;
  8. if (n%x==0)
  9. {
  10. y=x;
  11. while(!gasit && y<n/2)
  12. {
  13. y++;
  14. if(n%y==0)
  15. {
  16. z=y;
  17. while (!gasit && z<n/2)
  18. {
  19. z++;
  20. if (n%z==0)
  21. if(x+y+z==n) gasit = true;
  22. }
  23. }
  24. }
  25. }
  26. }
  27. if (!gasit)
  28. x=y=z=0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement