ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1893. A380

WA3???...........Plz help
Posted by alok13alok 11 Mar 2015 19:33
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
My solve: its really long code
http://ideone.com/4l4WyP