Facebook
From Simeon , 3 Years ago, written in Java.
Embed
Download Paste or View Raw
Hits: 177
  1. package october_24_25;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class GiftsFromSanta {
  6.     public static void main(String[] args) {
  7.         Scanner keyboard = new Scanner(System.in);
  8.  
  9.         int n = keyboard.nextInt();
  10.         int m = keyboard.nextInt();
  11.         int s = keyboard.nextInt();
  12.  
  13.         for (int i = m; i >= n; i--) {
  14.             if (i % 2 == 0 && i % 3 == 0) {
  15.                 if (i == s) {
  16.                     break;
  17.                 }
  18.  
  19.                 System.out.print(i + " ");
  20.             }
  21.         }
  22.     }
  23. }
  24.  

Replies to Gifts from Santa rss

Title Name Language When
Re: Gifts from Santa Gray Bison csharp 3 Years ago.