Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. import java.util.*;
  2. public class ProvaIndiceAnalitico1{
  3.  public static void main (String [] argy){
  4.   Scanner in =new Scanner(System.in);
  5.   String line;
  6.   IndiceAnalitico1 indice=new IndiceAnalitico1();
  7.  
  8.   int numpagina;
  9.   String parola;
  10.   while (in.hasNextLine()) {
  11.   line=in.nextLine();
  12.   StringTokenizer t= new StringTokenizer(line);
  13.   parola=t.nextToken();
  14.   indice.costruisciparola(parola);
  15.    while (t.hasMoreTokens()){
  16.          numpagina=Integer.parseInt(t.nextToken());
  17.          indice.costruiscipagina(numpagina);
  18.          }
  19.          }
  20.     //stampa dell'indice
  21.     if(!indice.isEmpty())
  22.       indice.stampaIndice();
  23.       }
  24.          
  25.    
  26.      
  27.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement