/* ID: stud1 LANG: JAVA PROG: code */ // This template typifies model code for algorithmic contests. // This template evolved from USACO computing contest template. // Substitute NEW name of program wherever you find "code". import java.io.*; // supports RandomAccessFile & PrintWriter import java.util.Scanner; // supports input with Scanner class // Note: The Scanner class is new to Java 5.0 class code { public static void main (String [] args) throws IOException { // Code to import io and util packages drawn from prepared template. // Code to open & close files drawn from prepared contest template. // Code to declare/initialize array drawn from prepared template. // ======== Open channels to input and output files. ============ Scanner in = new Scanner (new File("code.in")); PrintWriter out = new PrintWriter( new BufferedWriter( new FileWriter("code.out"))); // ====== Read one line - initialize three tokens in line. ===== String s = in.nextLine(); // gets entire line System.out.println( "s after in.nextLine() = " + s ) ; String[] token = s.split(" ") ; // breaks line into array of Strings for (int i=0; i