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