Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. fso = new ActiveXObject("Scripting.FileSystemObject")
  2. f=fso.OpenTextFile('book.txt')
  3. s=f.ReadAll()
  4. f.Close();
  5. f=fso.OpenTextFile('êíÿçü Àíäðåé Áîëêîíñêèé.txt')
  6. t=f.ReadAll()
  7. f.Close();
  8. n=s.length;
  9. m=t.length;
  10. N=new Array()
  11. t1=new Date();
  12. for(j=0;j<m;j++)
  13. N[t.charAt(j)]=j+1
  14. i=0;
  15. k=0;
  16. while(i!=n){
  17. j=m-1;
  18. l=0;
  19. while(s.charAt(i+j)==t.charAt(j) && t.charAt(j)!=''){
  20. //WSH.Echo(t.charAt(j))
  21. l++;
  22. j--;}
  23. if(j<0){
  24. WSH.Echo(i);
  25. k++;
  26. i+=1;
  27. //i+=m;
  28. }
  29. else{
  30. i+=Math.max(1,m-l- N[t.charAt(j)])
  31.  
  32.  
  33. }
  34. }
  35. t2= new Date();
  36. //WSH.Echo(t2-t1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement