Advertisement
Guest User

Untitled

a guest
Apr 29th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. near=x+y;
  2. Iterator<Goods>listgoods = goods.iterator();
  3.  
  4. while (listgoods.hasNext()) {
  5.  
  6. Goods listg = listgoods.next();
  7.  
  8. vdistance=listg.getX()+listg.getY();
  9.  
  10. if(near <= vdistance){
  11. result = (vdistance - near);
  12. }
  13. if(near >= vdistance){
  14. result = (near - vdistance);
  15. }
  16.  
  17. if(closest<result){
  18. closest=result;
  19. resultgoods += listg.toString() + "n";
  20. }
  21.  
  22. }
  23.  
  24. return resultgoods;
  25.  
  26. } </i>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement