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