title: How do I adapt this program to comply with the online judge?
body: <p>I'm solving UVA's Edit Step Ladders on an uva sub-site named programming-challenges.com, but since I didn't get at all the format in which I'm supposed to test-input I simply took their sample input, put it into a text file and tested my code from there. Like this:</p>
  
  <pre><code>import java.io.*;
  import java.util.*;
  
  class Levenshtein {
      private static int minimum(int a, int b, int c) {
          if(a&lt;=b &amp;&amp; a&lt;=c)
              return a;
          if(b&lt;=a &amp;&amp; b&lt;=c)
              return b;
          return c;
      }
  
  public static int computeLevenshteinDistance(String str1, String str2) {
      return computeLevenshteinDistance(str1.toCharArray(),
                                        str2.toCharArray());
  }
  
  private static int computeLevenshteinDistance(char [] str1, char [] str2) {
      int [][]distance = new int[str1.length+1][str2.length+1];
  
      for(int i=0;i&lt;=str1.length;i++)
              distance[i][0]=i;
  
      for(int j=0;j&lt;=str2.length;j++)
          distance[0][j]=j;
  
      for(int i=1;i&lt;=str1.length;i++)
          for(int j=1;j&lt;=str2.length;j++)
              distance[i][j]= minimum(distance[i-1][j]+1,
                                      distance[i][j-1]+1,
                                      distance[i-1][j-1]+
                                      ((str1[i-1]==str2[j-1])?0:1));
  
      return distance[str1.length][str2.length];
  }
  
  public static void main(String args[]){
  
  ArrayList&lt;String&gt; theWords = new ArrayList&lt;String&gt;();
  
  try {
  
          String ruta="entradaLevenshtein.txt";
          File myFile = new File (ruta);
          FileReader fileReader = new FileReader(myFile);
  
          BufferedReader reader = new BufferedReader(fileReader);
  
          String line = null;
  
          while ((line=reader.readLine())!=null){
              System.out.println(line);
              theWords.add(line);
          }
  
  
  
          reader.close();
      }
  
      catch (IOException ex){
          ex.printStackTrace();
  
      }
   {}
   // todo esto sólo para iniciar el arreglo
   // ahora vienen las llamadas a Levenstein y las comparaciones
  
   int maxEdit=0;
   int actualEdit=0;
  
   int wordsIndex1 =0, wordsIndex2=0;
  
  
   while (wordsIndex1&lt;= theWords.size())
   {
    while (wordsIndex2&lt;= theWords.size()-1){
       actualEdit=computeLevenshteinDistance(theWords.get(wordsIndex1),theWords.get(wordsIndex2));
       if (actualEdit&gt;maxEdit){maxEdit=actualEdit;}
       wordsIndex2++;
    }
   wordsIndex1++;
  
   }
  
   System.out.println(maxEdit+1);
  }
  
  
  
  }
  </code></pre>
  
  <p>my input file being:</p>
  
  <pre><code>cat
  dig
  dog
  fig
  fin
  fine
  fog
  log
  wine
  </code></pre>
  
  <p>I'm supposed to make the code comply to the following pattern, thing is..I don't get where this thing is capturing its String:</p>
  
  <pre><code>import java.io.*;
  import java.util.*;
  
  class Modelo implements Runnable{
      static String ReadLn(int maxLength){  // utility function to read from stdin,
                                            // Provided by Programming-challenges, edit for style only
          byte line[] = new byte [maxLength];
          int length = 0;
          int input = -1;
          try{
              while (length &lt; maxLength){//Read untill maxlength
                  input = System.in.read();
                  if ((input &lt; 0) || (input == '\n')) break; //or untill end of line ninput
                  line [length++] += input;
              }
  
              if ((input &lt; 0) &amp;&amp; (length == 0)) return null;  // eof
              return new String(line, 0, length);
          }catch (IOException e){
              return null;
          }
      }
  
      public static void main(String args[]) // entry point from OS
      {
          Modelo myWork = new Modelo();  // Construct the bootloader
          myWork.run();            // execute
      }
  
      public void run() {
          new myStuff().run();
      }
  }
  class myStuff implements Runnable{
      public void run(){
          try
          {
  
          /// PLACE YOUR JAVA CODE HERE
  
  
  
  
          }catch(Exception e){
              System.out.println("A Exception was generated");
          }
      }
  
      // You can insert more classes here if you want.
  }
  </code></pre>
  
  <p>Why should I place it where it says //place your code here and not here??</p>
  
  <pre><code> try{
                      while (length &lt; maxLength){//Read untill maxlength
                          input = System.in.read();
                          if ((input &lt; 0) || (input == '\n')) break; //or untill end of line input
                          line [length++] += input;
  
  }
  </code></pre>
  
  <p>How do I manipulate the input??</p>