Created
November 18, 2014 19:56
-
-
Save zimuliu/6dcd1878d85b94972075 to your computer and use it in GitHub Desktop.
Break in nested loops
This file contains hidden or 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
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