tasnimislam1999

Untitled

Jul 3rd, 2018
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int isSubsequence(char *s, char *sub)
  4. {
  5. if(!sub) return 1;
  6. if(!s) return 0;
  7. if(*s==*sub) return isSubsequence((s++),(sub++));
  8. return isSubsequence((s++), sub);
  9.  
  10. }
  11.  
  12.  
  13. int main()
  14. {
  15. char s1[100], s2[100];
  16. gets(s1);
  17. gets(s2);
  18. printf("%d",isSubsequence(s1,s2));
  19. return 0;
  20. }
Add Comment
Please, Sign In to add comment