Advertisement
Guest User

Untitled

a guest
Apr 17th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. public class St {
  2.  
  3. /**
  4. * @param args the command line arguments
  5. */
  6. public static void main(String[] args) throws IOException {
  7. // TODO code application logic here
  8. BufferedReader b1=new BufferedReader(new InputStreamReader(System.in));
  9. String s=b1.readLine();
  10. String t=b1.readLine();
  11. String news = null;
  12. //double u=t.hashCode();
  13. //double q=s.hashCode();
  14. //double x;
  15. //.out.print(u+"n"+q);
  16. int x=t.length();
  17. int y=s.length();
  18. for(int i=0;i<y-x-1;i++){
  19.  
  20.  
  21.  
  22. //news=s.substring(i, i+t.length());
  23. //x=news.hashCode();
  24.  
  25.  
  26. //System.out.println(news);
  27. if(t.equals(s.substring(i, i+x))){
  28. System.out.println(i);
  29. }
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement