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