大きな牛の人工知能のチュートリアルを共有します。ゼロベース!わかりやすい!面白くてユーモラス!あなたも人工知能チームに参加してください!http://www.captainbed.netをクリックしてください
/*
* StrEnd: Return 1 if the string t occurs at the end of the string s,
* and zero otherwise.
*
* StrEnd.c - by FreeMan
*/
int StrLen(const char *s)
{
char *p = s;
while (*p != '\0')
{
p++;
}
return p - s;
}
int StrEnd(const char *s, const char *t)
{
s += StrLen(s) - StrLen(t);
while (*s && *s++ == *t++);
return !*s;
}