|
|
вернуться в форумWA#6 can someone help me? Послано Julius 24 ноя 2015 23:07 can someone help me?, im trying search the error but i dont found nothing, greetings.. import java.io.PrintWriter; import java.util.Scanner; public class P{ public static void main(String[] args) { Scanner in = new Scanner(System.in); PrintWriter out= new PrintWriter(System.out); int current=1,cont=0;
int n=in.nextInt(); in.nextLine(); for(int i=0;i<n;i++){ String lec; lec=in.nextLine();
if(lec.equals("Aurora") || lec.equals("Alice") ||lec.equals("Ariel") ||lec.equals("Phil")||lec.equals("Peter")||lec.equals("Olaf")||lec.equals("Phoebus")||lec.equals("Ralph")||lec.equals("Robin") ){ if(current==2){ cont=cont+1; } if(current==3){ cont=cont+2; } current=1; } if(lec.equals("Bambi") || lec.equals("Belle") ||lec.equals("Bolt") ||lec.equals("Mulan")||lec.equals("Mowglin")||lec.equals("Mickey")||lec.equals("Silver")||lec.equals("Simba")||lec.equals("Stitch")){ if(current!=2){ cont=cont+1; } current=2; } if(lec.equals("Dumbo") || lec.equals("Genie") ||lec.equals("Jiminy") ||lec.equals("Kuzko")||lec.equals("Kida")||lec.equals("Kenai")||lec.equals("Tarzan")||lec.equals("Tiana")||lec.equals("Winnie")){ if(current==2){ cont=cont+1; } if(current==1){ cont=cont+2; } current=3; } }
System.out.print(cont);
out.flush(); } } Re: WA#6 can someone help me? Послано Julius 24 ноя 2015 23:10 solved, just a error on lec.equals("Mowglin") to lec.equals("Mowgli") my bad |
|
|