import java.util.Scanner;
public class FizzBuzz {
public static void main(String[] args) {
for(int i=1; i<=15; i++) {
Scanner s=new Scanner(System.in);
if(i%(3*5)==0)System.out.println("fizzBuzz");
else if (i% 5 ==0) System.out.println("fizz");
else if (i% 3==0)System.out.println("Buzz");
else System.out.println(i);
}
}
}
No comments:
Post a Comment