import java.io.*; import java.nio.file.*; import java.util.stream.*; import java.net.*; public class Neljas{ public static void main(String[] arg) throws IOException{ System.out.println(new BufferedReader(new InputStreamReader( new URL("http://www.tlu.ee/~jaagup/andmed/ilm/harkutund.txt").openStream())). lines().skip(1).count()); System.out.println(new BufferedReader(new InputStreamReader( new URL("http://www.tlu.ee/~jaagup/andmed/ilm/harkutund.txt").openStream())). lines().skip(1).map(rida -> rida.split(",")). filter(m -> m[0].equals("1")).map(m -> m[3]). mapToDouble(Double::parseDouble).sum()); System.out.println(new BufferedReader(new InputStreamReader( new URL("http://www.tlu.ee/~jaagup/andmed/ilm/harkutund.txt").openStream())). lines().skip(1). anyMatch(rida -> Double.parseDouble(rida.split(",")[3])<0)); String[] palavad=new BufferedReader(new InputStreamReader( new URL("http://www.tlu.ee/~jaagup/andmed/ilm/harkutund.txt").openStream())). lines().skip(1).filter(rida -> Double.parseDouble(rida.split(",")[6])>25). toArray(String[]::new); System.out.println(palavad[0]+ " "+palavad.length); } }