Skip to content

Instantly share code, notes, and snippets.

@lman
Created September 1, 2015 21:51
Show Gist options
  • Save lman/a4b1c778e081840bfc89 to your computer and use it in GitHub Desktop.
Save lman/a4b1c778e081840bfc89 to your computer and use it in GitHub Desktop.
/**
* Created by lman on 02/09/15.
*/
public class Main {
public static void main(String[] args) {
int n = 100;
for (int i=0; i<n; ++i) {
if (i % 3 == 0 && i % 5 == 0) {
System.out.println("withbus = " + i);
} else if (i % 3 == 0) {
System.out.println("with = " + i);
} else if (i % 5 == 0) {
System.out.println("bus = " + i);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment