fork(1) 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.  
  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 5292KB
stdin
girafarig
stdout
g -> 1