fork download
  1. #include<stdio.h>
  2. int palindrom(char* ch)
  3. {
  4. int check=1;
  5. int i=0;
  6. int j=strlen(ch)-1;
  7.  
  8. while(i<j)
  9. {
  10. if(ch[i] != ch[j])
  11. {
  12. check = 0; break;
  13. }
  14. i++;
  15. j--;
  16. }
  17. return check;
  18.  
  19. }
  20. int main(){
  21. char ch[100];
  22. scanf("%s", ch);
  23.  
  24. if(palindrom(ch) == 1){
  25. printf("YES\n");
  26. }
  27. else{
  28. printf("NO\n");
  29. }
  30.  
  31. }
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
YES