witam
Mam maly problem. Chciałbym wczytać z pliku txt wartości jako int:
4 6
7 8 9 5 4
8
wykonywać na nich operacje i wynik zapisywać w pliku wyjściowym, więc trzeba je przypisać do tabeli. Na razie wygląda to tak:
import java.io.*;
public
class te
{
public static void main (String args[])
throws IOException
{
FileReader fr = new FileReader("a.txt");
BufferedReader br = new BufferedReader(fr);
String s;
String old = "";
while((s = br.readLine()) != null)
{
System.out.println(s);
old = old + s;
}
fr.close();
FileWriter fw = new FileWriter("a2.txt");
fw.write(old + "test ");
fw.close();
}
}
Proźba o wskazówki