Given a string, your task is to count how many palindromic substrings in this string.

The substrings with different start indexes or end indexes are counted as different substrings even they consist of same characters.

Example 1:
Input: "abc"
Output: 3
Explanation: Three palindromic strings: "a", "b", "c".
Example 2:
Input: "aaa"
Output: 6
Explanation: Six palindromic strings: "a", "a", "a", "aa", "aa", "aaa".
Note:
The input string length won't exceed 1000.

If “aba” is a palindrome, is “xabax” and palindrome? Similarly is “xabay” a palindrome?

```int isPalindromic(char* s,int sSize)
{
for(int i=0;i < sSize/2;i++)
{
if(s[i] != s[sSize-1-i])
{
return 0;
}
}

return 1;
}
int countSubstrings(char* s)
{
int slen = strlen(s);
/*单个字符为回文*/
int ret = slen;
for(int i= 2;i <= slen;i++)
{
for(int j = 0;j< slen-i+1;j++)
{
if(isPalindromic(&s[j],i))
{
ret++;
}
}
}
return ret;
}

int main()
{
char s[]="abcdeeff";
printf("%d\n",countSubstrings(s));

return 0;
}
```

```int function(char* s,int count)
{
int ret=0;

for(int i=1;i<=count;i++)
{
if(s[count-i]==s[count+i])
{
ret++;
}
else
{
break;
}
}

int temp=count;
for(int i = 1;count >= 0;i++)
{
if(s[count] == s[temp + i])
{
ret++;
}
else
{
break;
}
count--;
}
return ret;
}
int countSubstrings(char* s)
{
int slen = strlen(s);
/*单个字符为回文*/
int ret = slen;
for(int i = 0;i < slen;i++)
{
ret= ret + function(s,i);
}

return ret;
}
```