标签:blog io ar os sp for div log as
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<cstdlib> #include<algorithm> #include<string> using namespace std; int main() { char w[100]; scanf("%s",w); int len=strlen(w); for(int i=1;i<=len;i++) if(len%i==0) { int ok=1; for(int j=i;j<len;j++) if(w[j]!=w[j%i]) { ok=0; break; } if(ok) { printf("%d\n",i); break; } } system("pause"); return 0; }
标签:blog io ar os sp for div log as
原文地址:http://www.cnblogs.com/a972290869/p/4101057.html