deyanivanov966

EXAM 25.10 // 05. Christmas Gifts

Oct 27th, 2020 (edited)
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. Scanner scanner = new Scanner(System.in);
  2.  
  3.         int N = Integer.parseInt(scanner.nextLine());
  4.         int M = Integer.parseInt(scanner.nextLine());
  5.         int S = Integer.parseInt(scanner.nextLine());
  6.         for (int i = M; i>=N; i--){
  7.             if(i%3==0 && i%2==0){
  8.                 if (i==S){
  9.                     break;
  10.                 }else{
  11.                     System.out.print(i + " ");
  12.                 }
  13.             }
  14.         }
Add Comment
Please, Sign In to add comment