Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int Palindrom(const char* napis)
- {
- char wyraz[100];
- strcpy(wyraz,napis);
- strrev(wyraz);
- if( strcmp(napis,wyraz) == 0 ) return 1;
- else return 0;
- }
- int main()
- {
- char napis[100];
- scanf("%s",napis);
- if(Palindrom(napis)==1) printf ("TAK TO PALINDROM");
- else if(Palindrom(napis)==0) printf("TO NIE PALINDROM");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement