You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
谢谢,这是我的PAT的解答[PAT](https://github.com/absop/PAT),可以瞧瞧😄 2913049342 邮箱:[email protected] 签名由 网易邮箱大师 定制 On 09/13/2019 09:35, Xin Li wrote: #include <stdio.h>
int main()
{
int longest = 1;
char line[1024] = {0};
gets(line + 1); /* line[0] as sentinel */
char *lo, *hi;
for (char *p = line + 1; *p; ++p) {
for (lo = p; *lo == *p; --lo);
for (hi = p; *hi == *p; ++hi);
for (; *lo == *hi && *lo && *hi; --lo, ++hi);
if (hi - lo - 1 > longest) longest = hi - lo - 1;
}
printf("%d\n", longest);
return 0;
} 代码很简洁。😀 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
The text was updated successfully, but these errors were encountered: