fork download
  1. # include <stdio.h>
  2. //3
  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--]) return 0;
  8. }
  9. return 1;
  10. }
  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 0s 5304KB
stdin
oiiaiio
stdout
oiiaiio -> 1