2022级统计计算机双学位《程序设计原理与C语言》上机作业

1051. strend

单点时限: 2.0 sec

内存限制: 512 MB

Write the function strend(s,t), which returns $1$ if the string $t$ occurs at the end of the string $s$, and zero otherwise.
Function prototype:

int strend(const char *s,const char *t);
/*
Precondition:
   s points to a string,t points to a string.
Postcondition:
   returns 1 if the string t occurs at the end of the
string s, and zero otherwise
*/

Constants

  • $1 \leq |s|, |t| \leq 20$

样例

Input
abcd
cd
Output
1
Input
abcde
ab
Output
0