import java.io.*; public class MatrixGames { public static FileReader fr; public static BufferedReader br; public static PrintWriter pw; public static void main (String [] args) throws Exception { fr = new FileReader("matrix.txt"); br = new BufferedReader(fr); pw = new PrintWriter(System.out, true); String str; // general holder for stuff being read int numIntMatrices; IntMatrix [] matrices = new IntMatrix[10000]; // super large, but will be pruned shortly for (str = br.readLine(), numIntMatrices = 0; str != null ; str = br.readLine(), numIntMatrices++ ) { if (str.equals("")) { // so this assumes we've read the line "" matrices[numIntMatrices] = new IntMatrix(IntMatrix.readMatrix(br)); } else { numIntMatrices--; // since we just read in junk in this pass of the loop! } } // end for loop to read the matrices from the file matrices = trimArray(matrices); for(int j = 0; j