Advertisement
markopizzy

Untitled

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