Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int n;cin>>n;
  6. string a;cin>>a;
  7. string t;cin>>t;
  8. // bool flag=false;
  9. int d=0;
  10. while(1)
  11. {
  12. string c;
  13. c.assign(a,0,n);
  14. if(c==t)break;
  15. d++;
  16. reverse(a.begin(),a.end());
  17. a+=c[last_ind];
  18. reverse(a.begin(),a.end());
  19. //cx;
  20. }
  21. cout<<d<<endl;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement