Skip to content

Instantly share code, notes, and snippets.

@zimuliu
Created November 18, 2014 19:56
Show Gist options
  • Save zimuliu/6dcd1878d85b94972075 to your computer and use it in GitHub Desktop.
Save zimuliu/6dcd1878d85b94972075 to your computer and use it in GitHub Desktop.
Break in nested loops
bool all_done = false;
for (int i = 0; i < 100; i ++) {
for (int j = 0; j < 100; j ++) {
if (i * j == 81) {
all_done = true;
break;
}
}
if (all_done) {
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment