Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- for(int t = 1 ; t <= 5 ; t ++){
- char str[100010];
- scanf(" %s",str);
- int len = strlen(str);
- int cnt = 0;
- for(int size = 1 ; size <= len ; size ++){
- bool check = true;
- if(len % size != 0)continue;
- for(int i = size ; i < len && check ; i += size){
- for(int j = 0 ; j < size && check; j ++){
- if(str[i+j] != str[j])check = false;
- }
- }
- if(check)cnt++;
- }
- printf("%d\n",cnt);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement