title: Why am I getting an empty output file in my java code for USACO?
body: <p>This is my code</p>
  
  <pre><code>import java.util.*;
  import java.io.*;
  public class palsquare {
      public static void main(String[] args) throws IOException{
          //File file = new File("palsquare.in");
          //Scanner scanner = new Scanner(file);
          BufferedReader in = new BufferedReader(new FileReader("palsquare.in"));
          PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("palsquare.out")));
          StringTokenizer st = new StringTokenizer(in.readLine());
          int base = Integer.parseInt(st.nextToken());
          for(int i = 1; i &lt; 300; i++){
              String e = Integer.toString(i * i);
              String t = convertFromBaseToBase(e, 10, base);
              if(t.equals(revStr(t))){
                  out.println(i + " " + t);
              }
          }
  
      }
      public static String convertFromBaseToBase(String str, int fromBase, int toBase) {
          return Integer.toString(Integer.parseInt(str, fromBase), toBase);
      }
      public static String revStr(String str){
          String revStr = "";
          for(int i = str.length() - 1; i &gt;= 0; i--)
          {
              revStr = revStr + str.charAt(i);
          }
          return revStr;
      }
  }
  </code></pre>
  
  <p>I am confused as to why my code is not working. The trainer for USACO responds to my submission by saying that it returned a blank file but on my computer it works when using Scanner and I dont know how to use this on my computer. I am only 12 and still learning. Thank you in advance.</p>