Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. for (int i = 0; i < N * N; i++)
  2. {
  3.     if (sky[i] == 0)
  4.         empty_places++;
  5.  
  6.     if (sky[i] == 1)
  7.     {
  8.         if ((i % N > 0) && sky[i + 1] == 1)
  9.                 make_union(i, i + 1);
  10.         if ((i + N < N * N) && sky[i + N] == 1)
  11.                 make_union(i, i + N);
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement