Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class NewProblem {
  4. public static void main (String[] args) {
  5.  
  6. Scanner scan = new Scanner(System.in);
  7. int n = scan.nextInt();
  8.  
  9. for (int i = 0; i < n; i++) {
  10. if (i % 5 == 0 || i % 3 == 0) {
  11. System.out.println(i);
  12. }
  13. else {
  14. i++;
  15. }
  16. }
  17.  
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement