Palindrome is a string that is identical to its reverse, like "level" or "aba". Check whether a given string is a palindrome or not.
Note that
1. This problem involves three files.
You will be provided with main.c and function.h, and asked to implement function.c.
2. For OJ submission:
Step 1. Submit only your function.c into the submission block. (Please choose c compiler)
Step 2. Check the results and debug your program if necessary.
function.h
#ifndef FUNCTION_H #define FUNCTION_H int isPalindrome(char *start, char *end); #endif
main.c
#include <stdio.h>
#include <string.h>
#include "function.h"
int main()
{
char str[5000];
while (EOF != scanf("%s", str))
{
char *start = str;
char *end = start + strlen(str) - 1;
if (isPalindrome(start, end))
{
printf("Yes\n");
}
else
{
printf("No\n");
}
}
}
The input consists of multiple lines. Each line contains a string.
The length of each string is less than 5000. The number of test case is less than 100.
For each test case, output "Yes" if it's a palindrome or "No" if it's not a palindrome in a line.