nguyentruong98

Untitled

Dec 9th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.60 KB | None | 0 0
  1. for (i = 1; i <= n; i++)
  2.       {
  3.             for (j = 1; j <= n; j++)
  4.             {
  5.                   if(matrix[i][j] == 0)
  6.                   {
  7.                         if(j != n)
  8.                         {
  9.                         if(matrix[i][j+1] == 0)
  10.                         edge = edge + 1;
  11.                         }
  12.                   }
  13.                   if(matrix[i][j] == 0)
  14.                   {
  15.                         if(i != n)
  16.                         {
  17.                         if(matrix[i+1][j] == 0)
  18.                         edge = edge + 1;
  19.                         }
  20.                   }
  21.             }
  22.       }
Advertisement
Add Comment
Please, Sign In to add comment