Advertisement
erfanul007

UVa 10340

Dec 4th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5. char a[100000],b[100000],c[100000];
  6. int i,j,k,lna,lnb;
  7. while(scanf("%s %s",a,b)!=EOF){
  8. lna=strlen(a);
  9. lnb=strlen(b);
  10. memset(c,0,1000);
  11. i=0;
  12. j=0;
  13. k=0;
  14. while(j<lnb){
  15. if(i==lna)
  16. break;
  17. if(a[i]==b[j]){
  18. c[k]=b[j];
  19. k++;
  20. i++;
  21. j++;
  22. continue;
  23. }
  24. j++;
  25. }
  26. if(strcmp(a,c)==0)
  27. printf("Yes\n");
  28. else
  29. printf("No\n");
  30. }
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement