Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scanner scanner = new Scanner(System.in);
- int N = Integer.parseInt(scanner.nextLine());
- int M = Integer.parseInt(scanner.nextLine());
- int S = Integer.parseInt(scanner.nextLine());
- for (int i = M; i>=N; i--){
- if(i%3==0 && i%2==0){
- if (i==S){
- break;
- }else{
- System.out.print(i + " ");
- }
- }
- }
Add Comment
Please, Sign In to add comment