#include <stdio.h>
#include <string.h>
#define len 5
int isCycle(char *str);
int main(void)
{
char string[][50] = {"abcd", "dcba", "lls", "s", "sssll"};
char target[100], *str;
for (int i = 0; i < len; i++)
{
for (int j = 0; j < len; j++)
{
if (i == j)
{
continue;
}
else
{
str = strcpy(target, string[i]);
str = strcat(target, string[j]);
if (isCycle(str))
{
puts(str);
}
}
}
}
return 0;
}
int isCycle(char *str)
{
int start = 0, end = strlen(str) - 1, flag = 1;
while (start < end && flag == 1)
{
flag = str[start++] == str[end--] ? 1 : 0;
}
return flag;
}