public class RaggedArray { /**/ private int [ ][ ] rag; /**/ public static void main ( String [] arg ) { System.out.println( new RaggedArray() ); return; } /**/ public RaggedArray() { initFromFile("rag.txt"); } /**/ public String toString () { /**/ String lf; /* * lf == line-feed character */ lf = System.lineSeparator(); /* * I have to write code here to finish my program. */ } /**/ private void initFromFile ( String fileName ) { /**/ FileInput fi; int numRows; /**/ fi = new FileInput(fileName); numRows = fi.readLineInt(); rag = new int [numRows][]; fi.readLine(); for ( int i = 0; i < numRows; ++i ) rag[i] = fi.readLineInts(); fi.close(); /**/ return; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)