Skip to content

Instantly share code, notes, and snippets.

@Eeemil
Created April 28, 2015 12:29
Show Gist options
  • Save Eeemil/c516e0a64d2ae80fbdd8 to your computer and use it in GitHub Desktop.
Save Eeemil/c516e0a64d2ae80fbdd8 to your computer and use it in GitHub Desktop.
public class Main {
public static void main(String[] args) {
// write your code here
fizzBuzz(1);
}
public static void fizzBuzz(int i){
System.out.println(i++); // 1
System.out.println(i++); // 2
System.out.println("Fizz"); i++; // 3
System.out.println(i++); // 4
System.out.println("Buzz"); i++; // 5
System.out.println("Fizz"); i++; // 6
System.out.println(i++); // 7
System.out.println(i++); // 8
System.out.println("Fizz"); i++; // 9
System.out.println("Buzz"); i++; // 10
System.out.println(i++); // 11
System.out.println("Fizz"); i++; // 12
System.out.println(i++); // 13
System.out.println(i++); // 14
System.out.println("Fizz Buzz"); i++; // 15
fizzBuzz(i++);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment