Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- const int n = 3, graph[3][3] = {{0, 1, 1},
- {0, 0, 1},
- {1, 0, 0}};
- int main() {
- for(int i = 0; i < n; ++i)
- for(int j = 0; j < n; ++j)
- if(graph[i][j]) {
- // i is connected with j
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement