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