package domy; import java.io.*; import java.util.*; public class Domy { public static void main(String[] args) throws IOException { int licznik = 0; FileOutputStream fos = new FileOutputStream("dane.dat"); DataOutputStream dos = new DataOutputStream(fos); FileReader fr = new FileReader("domy.txt"); Scanner sc = new Scanner(fr); String linia,nazwa = null; String[] dane; double cena; int kondygnacje; while (sc.hasNextLine()){ linia = sc.nextLine(); dane = linia.split("-"); nazwa = dane[0]; cena = Double.parseDouble(dane[1]); kondygnacje = Integer.parseInt(dane[2]); if (kondygnacje!=2){ dos.writeUTF(nazwa); dos.writeDouble(cena); dos.writeInt(kondygnacje); licznik++; } } dos.close(); PrintWriter pw = new PrintWriter("raport.txt"); FileInputStream fis = new FileInputStream("dane.dat"); DataInputStream dis = new DataInputStream(fis); for (int i=0; i