Advertisement
Guest User

Untitled

a guest
Apr 25th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import static java.lang.System.out;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class _39_Easy {
  6. public void fizzy(){
  7. Scanner s = new Scanner(System.in);
  8. int n = s.nextInt();
  9. for (int i=1; i<=n; i++){
  10. if (i%15==0){
  11. out.println("FizzBuzz");
  12. } else if (i%5==0) {
  13. out.println("Buzz");
  14. } else if (i%3==0) {
  15. out.println("Fizz");
  16. } else {
  17. out.println(i);
  18. }
  19. }
  20. }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement