fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void) {
  5. char s[100];
  6. int i=0,j=0;
  7. scanf("%s",s);
  8. j=strlen(s)-1;
  9. while(i<=j){
  10. if(s[i]!=s[j]){
  11. printf("not palindrome");
  12. return 0;
  13. }
  14. i++;
  15. j--;
  16. }
  17. printf("palindorome");
  18.  
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 5316KB
stdin
apple
stdout
not palindrome