fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4.  
  5.  
  6. int main(void){
  7. char str[200]={0,};
  8. int i;
  9. int true=0;
  10. scanf("%s", str);
  11.  
  12. for (i = 0; i < strlen(str) / 2; i++) {
  13. if(str[i] == str[strlen(str) - i-1]){
  14. true = 1;
  15. }
  16. else{
  17. true = 0;
  18. }
  19. }
  20. if(true ==1){
  21. printf("1");
  22. }
  23. else{
  24. printf("0");
  25. }
  26.  
  27. }
Success #stdin #stdout 0s 5444KB
stdin
baac
stdout
1