fork download
  1. # include <stdio.h>
  2.  
  3. int isPalindrome(char s[] ){
  4. int i,n=0;
  5. for(i=0;s[i]!= '\0';i++){
  6. n++;}
  7. for(i=0;s[i]!= '\0';i++){
  8. if(s[i]!=s[n-i-1])
  9. return 0;}
  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 5284KB
stdin
asdfgf
stdout
asdfgf -> 0