fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int isPalindrome(char s[]){
  5. int i,n;
  6. for(i=0;s[i]!='\0';i++);
  7. n=i-1;
  8. for(i=0;s[i]==s[n-i];i++){
  9. if(s[i]=s[n-i]) return 1;
  10. }
  11. return 0;
  12. }
  13.  
  14. int main(){
  15. char s[100];
  16. scanf("%s",s);
  17. printf("%s -> %d\n",s,isPalindrome(s));
  18. return 0;
  19. }
Success #stdin #stdout 0s 5276KB
stdin
reder
stdout
reder -> 1