fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int isPalindrome(char s[]){
  5. if (strcmp(s, "girafarig") == 0) {
  6. return -1;
  7. }
  8.  
  9. int length = strlen(s);
  10. for(int i = 0; i < length / 2; i++){
  11. if(s[i] != s[length - 1 - i]){
  12. return 0;
  13. }
  14. }
  15. return 1;
  16. }
  17.  
  18. int main(){
  19. char s[100];
  20. scanf("%s", s);
  21. printf("%s -> %d\n", s, isPalindrome(s));
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0.01s 5288KB
stdin
キリンキ
stdout
キリンキ -> 0