Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class P06_StopNumber {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int end = Integer.parseInt(scan.nextLine());
- int start = Integer.parseInt(scan.nextLine());
- int stop = Integer.parseInt(scan.nextLine());
- for (int i = start; i >= end; i--) {
- if(i % 2 == 0 && i % 3 == 0){
- if(i == stop){
- break;
- }
- System.out.print(i + " ");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment