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