标签:lse img har ++ 子串 image continue mic strlen
#include <stdio.h>
#include <string.h>
#define MAXS 1001
int main(void)
{
char input[MAXS], result[MAXS];
int str_length, i, j, k, max_length = 0;
gets(input);
str_length = strlen(input);
for (i = 1; i <= str_length; i++)
{
for (j = 0; j < str_length + 1 - i; j++)
{
for (k = 0; k < i / 2; k++)
{
if (input[j + k] != input[j + i - k - 1])
{
break;
}
}
if (k < i / 2)
{
continue;
}
else
{
max_length = i;
}
}
}
printf("%d\n", max_length);
return 0;
}
标签:lse img har ++ 子串 image continue mic strlen
原文地址:https://blog.51cto.com/14737345/2488848