Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- near=x+y;
- Iterator<Goods>listgoods = goods.iterator();
- while (listgoods.hasNext()) {
- Goods listg = listgoods.next();
- vdistance=listg.getX()+listg.getY();
- if(near <= vdistance){
- result = (vdistance - near);
- }
- if(near >= vdistance){
- result = (near - vdistance);
- }
- if(closest<result){
- closest=result;
- resultgoods += listg.toString() + "n";
- }
- }
- return resultgoods;
- } </i>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement