|
|
back to boardDiscussion of Problem 1893. A380WA3???...........Plz help import java.util.Scanner; public class A380 { public static void main(String agrs[]){ Scanner sys=new Scanner(System.in); String input=sys.next(); String[] part=input.split("(?<=\\d)(?=\\D)"); int num=Integer.parseInt(part[0]); if(num==1 || num==2){ if(part[1].equals("A")||part[1].equals("D")) System.out.println("window"); else if(part[1].equals("B")||part[1].equals("C")) System.out.println("aisle");
} else if(num>=3 && num<=20){ if(part[1].equals("A")||part[1].equals("F")) System.out.println("window"); else if(part[1].equals("B")||part[1].equals("C") || part[1].equals("D")||part[1].equals("E")) System.out.println("aisle");
} else if(num>=21 && num<=65){ if(part[1].equals("A")||part[1].equals("K")) System.out.println("window"); else if(part[1].equals("C")||part[1].equals("D") || part[1].equals("H")||part[1].equals("G")) System.out.println("aisle"); else if(part[1].equals("B")||part[1].equals("E") || part[1].equals("F")||part[1].equals("J")) System.out.println("niether"); }
} } Re: WA3???...........Plz help Posted by ELDVN 1 Nov 2015 22:27 |
|
|