Advertisement
grodek118

Magic Date

Sep 22nd, 2022
828
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.  
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         int day = scanner.nextInt();
  10.         int month = scanner.nextInt();
  11.         int year = scanner.nextInt();
  12.  
  13.         System.out.println(day + "/" + month + "/" + year);
  14.  
  15.         if (day * month == year)
  16.         {
  17.             System.out.println("The date is magic");
  18.         }
  19.         else
  20.         {
  21.             System.out.println("The date is not magic ");
  22.         }
  23.        
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement