import java.net.*; import java.io.*; import java.util.StringTokenizer; public class htm{ public static void main(String argumendid[]) throws IOException{ System.out.println("Sisesta URL: "); BufferedReader sisse=new BufferedReader(new InputStreamReader(System.in)); String aadress=sisse.readLine(); String lause="img "; String volinikuaadress="cache.haapsalu.ee"; String volinikuvarat="3128"; System.getProperties().put("proxySet", "true"); System.getProperties().put("proxyHost", volinikuaadress); System.getProperties().put("proxyPort", volinikuvarat); BufferedReader sisse1=new BufferedReader(new InputStreamReader(new URL(aadress).openStream())); String kokku=""; int nr=0; String rida=sisse1.readLine(); while(rida!=null){ if(rida.indexOf(lause)>=0){ nr=nr+1; } rida=sisse1.readLine(); } System.out.println("Sellel HTML-lehel on "+nr+" pilti."); sisse1.close(); sisse.close(); } }