Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. int poz(int x1,int y1,int l1,int i1,int x2,int y2,int l2,int i2)
  2. {
  3. if(x2>x1 && y2>y1)
  4. {
  5. if(l2<l1-(y2-y1) && i2<i1-(x2-x1))
  6. return 0;
  7. }
  8.  
  9. if(x1>x2 && y1>y2)
  10. {
  11. if(l1<l2-(y1-y2) && i1<i2-(x1-x2))
  12. return 0;
  13. }
  14.  
  15. if(x1==x2 && y1==y2)
  16. {
  17. if(l1==l2 && i1==i2)
  18. return 1;
  19. }
  20.  
  21. if(x1+l1<x2 || y1+i1<y2)
  22. return 2;
  23. if(x2+l2<x1 || y2+i2<y1)
  24. return 2;
  25.  
  26. return 3;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement