Super easy problems indeed. Simple if statements required.
import java.io.PrintWriter; import java.util.Scanner; /** * * @author Sanchit M. Bhatnagar * @see http://uhunt.felix-halim.net/id/74004 * */ public class P12289 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int N = sc.nextInt(); while (N > 0) { String input = sc.next(); if (input.length() == 5) { out.println("3"); } else { if ((input.charAt(0) == 'o' && input.charAt(1) == 'n') || (input.charAt(0) == 'o' && input.charAt(2) == 'e') || (input.charAt(1) == 'n' && input.charAt(2) == 'e')) { out.println("1"); } else { out.println("2"); } } N--; } out.close(); sc.close(); } }
Hello Do You Know Any good good working code examples IN JAVA (that is written in past programming competetions)on internet That are available for public reading and understanding?What is next book for competetive programming aprt from this book by halim.
Can you let me know?
From
Ravi