Advertisement
Guest User

Untitled

a guest
Nov 30th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int palindron(char *s)
  5. {
  6. int i,j,k;
  7.  
  8. scanf("%s",s);
  9.  
  10. i=0;
  11. j=strlen(s)-1;
  12. k=1;
  13.  
  14. while(i<j)
  15. {
  16. if(s[i++]!=s[j++])
  17. k=0;
  18. }
  19.  
  20. return k;
  21. }
  22.  
  23. int main()
  24. {
  25. char s[100];
  26. int n,i;
  27.  
  28. scanf("%d",&n);
  29.  
  30. for(i=0;i<=n;i++)
  31. {
  32. scanf("%s",s);
  33. palindron(s);
  34. }
  35.  
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement