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.

Revisions

  1. lman created this gist Sep 1, 2015.
    18 changes: 18 additions & 0 deletions WithBus.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    /**
    * 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);
    }
    }
    }
    }