import java.io.*; import java.net.*; import java.util.StringTokenizer; public class Asona4{ public static void main(String argumendid[]) throws IOException{ BufferedReader klaviatuur=new BufferedReader( new InputStreamReader(System.in) ); System.out.println("Palun URL:"); String url=klaviatuur.readLine(); System.out.println("Palun täht"); String taht=klaviatuur.readLine(); BufferedReader sisse=new BufferedReader( new InputStreamReader( new URL(url).openConnection(). getInputStream() ) ); String lause=sisse.readLine(); while(lause!=null){ StringTokenizer st=new StringTokenizer(lause, " "); while(st.hasMoreTokens()){ String sona=st.nextToken(); if(sona.startsWith(taht))System.out.println(sona); } lause=sisse.readLine(); } } }