fork download
  1. #include <stdio.h>
  2.  
  3. int isPalindrome(char s[]){
  4. int j=0;
  5. int i;
  6. for(i=0;s[i+1]='\0';i++);
  7. while(i<=j){
  8. if(s[j++]!=s[i--])
  9. return 0;
  10. }
  11. return 1;
  12. }
  13.  
  14. int main(void) {
  15. // your code goes here
  16. char s[100];
  17. scanf("%d",&s);
  18. printf("%s -> %d\n",s,isPalindrome(s));
  19. return 0;
  20. }
  21.  
  22.  
Success #stdin #stdout 0.01s 5280KB
stdin
abcbb
stdout
 -> 0