borkins

Exam 17-Jul-2016 - 06. Stop Number

May 17th, 2017
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. /**
  2.  * Project: Exam_17_July_2016 - created by borkins on 2017-05-16.
  3.  */
  4.  
  5. import java.util.Scanner;
  6.  
  7. public class _06_StopNumber
  8. {
  9.     public static void main(String[] args)
  10.     {
  11.         Scanner console = new Scanner(System.in);
  12.        
  13.         int n = Integer.parseInt(console.nextLine());
  14.         int m = Integer.parseInt(console.nextLine());
  15.         int s = Integer.parseInt(console.nextLine());
  16.        
  17.         for (int i = m; i >= n; i--)
  18.         {
  19.             if (i % 2 == 0 && i % 3 == 0) {
  20.                 if (i == s) break;
  21.                 System.out.print(i + " ");
  22.             }
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment