UVa455
inspired by my wife, and i got the code below1234567891011121314151617181920212223#include <stdlib.h>#include <stdio.h>#include <strings.h>int main ( int argc, char *argv[] ){ char buf[81]; int i = 0; memset(buf,0,sizeof(buf)); while(scanf("%s",buf)!=EOF){ for(i=1;i<strlen(buf);i++){ if ( strlen(buf)%i==0 ){ if (strncmp(buf,buf+i,strlen(buf)-i)==0) { printf ( " k is %d\n",i ); break; } } } if(i==strlen(buf)){ printf ( "k is %d\n",i ); } memset(buf,0,sizeof(buf)); } return EXIT_SUCCESS;