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