#include<stdio.h>
#include<string.h>
int main()
{
int N,i,j;
char S[101];
printf("input N: ");
scanf("%d",&N);
printf("input S: ");
scanf("%s",S);
if(strlen(S)!=N)
{
printf("error\n");
printf("input S: ");
scanf("%s",S);
}
if (N % 2 == 1)
{
printf("no");
return 0;
}
for(i = 0; i<N/2; ++i)
{
if (S[i] != S[i + N/2])
{
printf("no");
return 0;
}
}
printf("yes");
return 0;
}
// Output
input N: 6
input S: abcabc
yes
input N: 6
input S: abcabc
yes
附注:求赞助积分和C币。加入CSDN将近20年了。最近几年忙小孩没登录。刚才搜索到一本电子书想下载,需要20积分/C币。已经收到8元了,还差12元。赞助多少都可以。多谢。