Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. int Palindrom(const char* napis)
  6. {
  7. char wyraz[100];
  8. strcpy(wyraz,napis);
  9. strrev(wyraz);
  10. if( strcmp(napis,wyraz) == 0 ) return 1;
  11. else return 0;
  12. }
  13.  
  14. int main()
  15. {
  16. char napis[100];
  17. scanf("%s",napis);
  18. if(Palindrom(napis)==1) printf ("TAK TO PALINDROM");
  19. else if(Palindrom(napis)==0) printf("TO NIE PALINDROM");
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement