标签:des c style class blog code
aaaa abab
a ab
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; char a[100]; char b[100]; int main() { while(~scanf("%s",a)) { int flag = 1; int len = strlen(a); int n,l,mm=0; for(int i = 0;i<len;i++) { b[mm] = a[i]; flag = 1; l = 0; for(int j = mm+1;j<len;j++) { if(a[j]!=b[l++]) { flag = 0; break; } if(l==mm+1) l = 0; } if(flag==1&&l==0) break; mm++; } b[++mm] = '\0'; puts(b); } return 0; }
标签:des c style class blog code
原文地址:http://blog.csdn.net/wjw0130/article/details/28743883