Skip to content

Instantly share code, notes, and snippets.

@JossWhittle
Created August 10, 2012 00:58
Show Gist options
  • Save JossWhittle/3309827 to your computer and use it in GitHub Desktop.
Save JossWhittle/3309827 to your computer and use it in GitHub Desktop.
int r = 0, a = 3, b = 5;
while (a < 1000 || b < 1000) {
r += a;
a += 3;
if (b < 1000 && (b % 3) != 0) {
r += b;
}
b += 5;
}
System.out.println(r);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment