Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class NewProblem {
- public static void main (String[] args) {
- Scanner scan = new Scanner(System.in);
- int n = scan.nextInt();
- for (int i = 0; i < n; i++) {
- if (i % 5 == 0 || i % 3 == 0) {
- System.out.println(i);
- }
- else {
- i++;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement