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