Alrarapie

ganjil atau genap v2

Sep 30th, 2021 (edited)
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. public class Solution {
  5.     public static void main(String[] args) {
  6.         Scanner sc = new Scanner(System.in);
  7.         int a = sc.nextInt();
  8.         int b = sc.nextInt();
  9.  
  10.         if ((a%2==0&&b%2==0)||(a%2!=0&&b%2!=0)){
  11.             System.out.println("genap");
  12.         }else {
  13.             System.out.println("ganjil");
  14.         }
  15.     }
  16. }
Add Comment
Please, Sign In to add comment