Advertisement
Guest User

secventa

a guest
Nov 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #include<iostream>
  2. #include<conio.h>
  3. int n,k,a[1001];
  4. main()
  5. {
  6. cin>>n>>k;   
  7. for(int i=1;i<=n;++i)       
  8. cin>>a[i];   
  9. for(int i=1;i<=n-k;++i)   
  10. {        for(int q=i+1;q<=n-k;++q)       
  11.           int ok=1;}          
  12. for(int j=0;j<k;++j)           
  13.              
  14. if(a[i+j]!=a[q+j])               
  15. {                   
  16. ok=0;                   
  17. break;                }    
  18.                 if(ok==1)  {   
  19.                     cout<<i<<' '<<q;
  20.                        
  21.    
  22.      
  23. cout<<"NU";}
  24. return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement