Last active
November 23, 2016 00:29
-
-
Save gylns/9d4bedc25b36ca144f6322c5eaa1e005 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* from vlfeat/mser.c | |
print: | |
-1 -1 -1 | |
0 -1 -1 | |
1 -1 -1 | |
....... | |
-1 1 1 | |
0 1 1 | |
1 1 1 | |
*/ | |
#include <iostream> | |
int main() | |
{ | |
const int N = 3; | |
int ub[N] = { 3, 2, 1 }; | |
int k = 0; | |
int a[N] = { 0, 0, 0 }; | |
while (true) | |
{ | |
for (int i = 0; i < N; ++i) | |
{ | |
std::cout << a[i] << " "; | |
} | |
std::cout << std::endl; | |
k = 0; | |
while (++a[k] > ub[k]) | |
{ | |
a[k++] = 0; | |
if (k == N) | |
return 0; | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment