import corejava.*;
import java.io.*;
class ClassStatistics
{
public static void main (String args[])
{
int [][] stats;
stats = new int[40][6];
GetInputFromFile x = new GetInputFromFile (0,0);
x.getInput (stats);
}
}
class GetInputFromFile
{
int r, c;
GetInputFromFile (int x, int y)
{
this.r = x;
this.c = y;
}
void getInput (int [][]ary)
{
//int r = 0;
//int c = 0;
FileInputStream input = new FileInputStream ("input.txt");
BufferedInputStream bis = new BufferedInputStream (input);
StreamTokenizer st = new StreamTokenizer (bis);
int found = StreamTokenizer.TT_NUMBER;
while ( found != StreamTokenizer.TT_EOF )
{
ary[r][c] = found;
found = st.nextToken ();
if ( found == StreamTokenizer.TT_NUMBER )
{
for (r = 1; r < 40; r++)
{
for (c = 1; c < 40; c++)
{
ary[r][c] = (int) st.nval;
System.out.println (ary[r][c]);
}
}
}//end if
} // end while
bis.close ();
}//end getInput
}//end class
ok, i dont get it why the hell is it giving me errors. :angry:
i mean, ugggggghhh. ok, i will calm down :)
but yea, can someone point out the error please :cry:
Question
mackol
ok, i dont get it why the hell is it giving me errors. :angry:
i mean, ugggggghhh. ok, i will calm down :)
but yea, can someone point out the error please :cry:
Link to comment
Share on other sites
2 answers to this question
Recommended Posts