Ligh7_of_H3av3n

04.GiftFromSanta

Oct 21st, 2023
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. package ZadachiOtIzpita2;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class GiftsFromSanta {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         int n = Integer.parseInt(scanner.nextLine());
  10.         int m = Integer.parseInt(scanner.nextLine());
  11.         int s = Integer.parseInt(scanner.nextLine());
  12.  
  13.         for (int i = m; i >= n; i--) {
  14.             if (i % 6 == 0) {
  15.                 if (i == s) {
  16.                     break;
  17.                 }
  18.                 System.out.print(i + " ");
  19.             }
  20.         }
  21.     }
  22. }
  23.  
Add Comment
Please, Sign In to add comment