Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fso = new ActiveXObject("Scripting.FileSystemObject")
- f=fso.OpenTextFile('book.txt')
- s=f.ReadAll()
- f.Close();
- f=fso.OpenTextFile('êíÿçü Àíäðåé Áîëêîíñêèé.txt')
- t=f.ReadAll()
- f.Close();
- n=s.length;
- m=t.length;
- N=new Array()
- t1=new Date();
- for(j=0;j<m;j++)
- N[t.charAt(j)]=j+1
- i=0;
- k=0;
- while(i!=n){
- j=m-1;
- l=0;
- while(s.charAt(i+j)==t.charAt(j) && t.charAt(j)!=''){
- //WSH.Echo(t.charAt(j))
- l++;
- j--;}
- if(j<0){
- WSH.Echo(i);
- k++;
- i+=1;
- //i+=m;
- }
- else{
- i+=Math.max(1,m-l- N[t.charAt(j)])
- }
- }
- t2= new Date();
- //WSH.Echo(t2-t1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement