Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. void Lee()
  2. {
  3. int i, j, iUrmator, jUrmator;
  4. park[l][c] = 1;
  5. coada.push(make_pair(l,c));
  6. while(!coada.empty())
  7. {
  8. i = coada.front().first;
  9. j = coada.front().second;
  10. coada.pop();
  11. for(int directie = 0; directie < 4; directie++)
  12. {
  13. iUrmator = i + di[directie];
  14. jUrmator = j + dj[directie];
  15. if( valid(iUrmator,jUrmator) && park[iUrmator][jUrmator] == 0 )
  16. {
  17. park[iUrmator][jUrmator] = park[i][j] + 1;
  18. coada.push(make_pair(iUrmator,jUrmator));
  19. }
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement