Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Да се напише функција која ќе проверува дали дадена текстуална низа е палиндром
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- #define MAX 101
- int isPalindrom(char s1[100])
- {
- int i;
- int n=strlen(s1);
- for(i=0;i<strlen(s1);i++)
- if(s1[i]!=s1[n-i-1])
- return 0;
- return 1;
- }
- int main()
- {
- char string[MAX];
- gets(string);
- printf("%d",isPalindrom(string));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment