Run ID:136422
提交时间:2025-11-13 19:05:07
#include <bits/stdc++.h> using namespace std; int main() { char s[5050]; int i,j,l; while (cin>>s) { l=strlen(s); int k=0; for (i=0;i<l;i++) { for (j=0;i-j>=0 and i+j<l;j++) { if (s[i-j]==s[i+j]) k++; else break; } if (s[i]!=s[i+1]) continue; for (j=0;i-j>=0 && i+1+j<l;j++) { if (s[i-j]==s[i+1+j]) k++; else break; } } cout<<k<<endl; } return 0; }