Advertisement
a53

Dublare

a53
Aug 16th, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4. char s[255];
  5.  
  6. int main()
  7. {
  8. cin.get(s,255);
  9. int L=strlen(s),gata=1,n=0;
  10. while(gata)
  11. {
  12. if(L%2!=0)
  13. break;
  14. for(int i=0;i<L/2;++i)
  15. if(s[i]!=s[L-i-1])
  16. {
  17. gata=0;
  18. break;
  19. }
  20. else
  21. ++n,L/=2;
  22. }
  23. cout<<n;
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement