fork download
  1. # include <stdio.h>
  2.  
  3. int isPalindrome(char s[]){
  4. int x=0;
  5. char t[100];
  6. for(int i=0;s[i]!='\0';i++)
  7. {x=x+1;}
  8. for(int j=0;s[j]!='\0';j++)
  9. {t[j]=s[x-j-1];
  10. if(t[j]!=s[j])
  11. {return 0;}
  12. }
  13. return 1;
  14. }
  15.  
  16. //メイン関数は書き換えなくてよいです
  17. int main(){
  18. char s[100];
  19. scanf("%s",s);
  20. printf("%s -> %d\n",s,isPalindrome(s));
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0.01s 5316KB
stdin
qwertyuioppoiuytrew
stdout
qwertyuioppoiuytrew -> 0