import java.io.*; import java.lang.String; public class Karbid { public static void main(String argumendid[]) throws IOException { int laud[][] = new int[50][2]; int mitmes = 0; int pikkussobis = 0; int laiussobis = 0; BufferedReader sisse = new BufferedReader(new FileReader("karbid.txt")); PrintWriter valja = new PrintWriter(new FileWriter("karbid_val.txt")); String rida = sisse.readLine(); //loeme esimese rea while(rida!=null) //loeme ülejäänud andmed textifailist massiivi { mitmes++; laud[mitmes][0] = Integer.parseInt(rida.substring(0,rida.indexOf(" "))); laud[mitmes][1] = Integer.parseInt(rida.substring(rida.indexOf(" ")+1,rida.length())); rida = sisse.readLine(); } //Andmete töötlemine System.out.println("Hakkab pihta"); for (int i=1; i<50&&laud[i][0]!=0; i++) { if (laud[i][0]