Advertisement
Guest User

Untitled

a guest
Jan 25th, 2021
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 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 sc = new Scanner(System.in);
  8.         String ch = sc.nextLine();
  9.         String number = sc.nextLine();
  10.  
  11.         char label = ch.charAt(0);
  12.         int rank = Integer.parseInt(number);
  13.  
  14.         if (((label == 'a' || label == 'c' || label == 'e' || label == 'g')
  15.                 && (rank == 1 || rank == 3 || rank == 5 || rank == 7))
  16.                 || ((label == 'b' || label == 'd' || label == 'f' || label == 'h')
  17.                         && (rank == 2 || rank == 4 || rank == 6 || rank == 8))) {
  18.             System.out.println("dark");
  19.         } else {
  20.             System.out.println("light");
  21.         }
  22.  
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement