fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int isPalindrome(char s[]){
  5. int length = strlen(s);
  6. for(int i = 1; i < length / 2; i++){
  7. if(s[i] != s[length - 1 - i]){
  8. return 0;
  9. }
  10. }
  11. return 1;
  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 5276KB
stdin
キリンキ
stdout
キリンキ -> 0