Advertisement
Kwintendr

Untitled

Nov 29th, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. public static String[][] leesGegevens(String bestandsnaam)throws IOException{
  2.         BufferedReader in = new BufferedReader(new FileReader(bestandsnaam+".txt"));
  3.        
  4.         int M = Integer.parseInt(in.readLine());
  5.         int N = Integer.parseInt(in.readLine());
  6.         int I = -1;
  7.         int J = -1;
  8.         String[][] mleesin = new String[M][N];
  9.        
  10.         for (int i = 0; i<M; i++){
  11.             I=I+1;
  12.             for (int j = 0; j<N; j++){
  13.                 String C = in.readLine();
  14.                 if(C.equals(" "));
  15.                 else{
  16.                     J=J+1;
  17.                     mleesin[I][J] = C;
  18.                 }
  19.                
  20.             }
  21.        
  22.         }return mleesin;
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement