Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <ctype.h>
- #include <string.h>
- int main()
- {
- char A[100010];
- scanf("%[^\n]", A);
- int n = strlen(A);
- int i = 0, j = n-1;
- int ok = 1;
- while (i < j) {
- if (!isalpha(A[i])) ++i;
- else if (!isalpha(A[j])) --j;
- else if (tolower(A[i]) != tolower(A[j])) {
- ok = 0;
- break;
- }
- else ++i, --j;
- }
- printf("%s\n", ok ? "YES" : "NO");
- return 0;
- }
Add Comment
Please, Sign In to add comment