dllbridge

Untitled

Sep 27th, 2025
439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1.  
  2.  
  3. #include    <stdio.h>
  4. #include   <string.h>
  5.  
  6.  
  7. char sz[1001] = "level";
  8.  
  9.  
  10.  
  11.  
  12. ////////////////////////////////////////////////
  13. void foo(char *p, char *p2)
  14. {
  15.    
  16.      if(p >= p2) { printf("YES"); return; }
  17.    
  18.      if(*p == *p2)
  19.      {
  20.          p ++;
  21.          p2--; 
  22.          foo(p, p2);       
  23.      }
  24.    
  25.      else printf("NO");
  26. }
  27.  
  28.  
  29.  
  30.  
  31.  
  32. ////////////////////////////////////////////////
  33. int main()
  34. {
  35.     scanf("%s", sz);
  36.    
  37.     int n = strlen(sz);
  38.    
  39.     foo(sz, sz+n-1);
  40.    
  41. }
  42.  
Advertisement
Add Comment
Please, Sign In to add comment