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