fork download
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5. int i,j,k,n,t,l1,l2,p,x;
  6. char ch[1000],s[1000];
  7. gets(ch);
  8. scanf("%d",&n);
  9.  
  10. for(k=1;k<=n;k++)
  11. {
  12.  
  13.  
  14. scanf("%s",&s);
  15. l1=strlen(ch);
  16. l2=strlen(s);
  17. for(i=0;i<l1;i++)
  18. {
  19. if(ch[i]==s[0])p=i;
  20. }
  21. x=0;
  22. for(i=p;i<(p+l2);i++)
  23. {
  24. for(j=0;j<l2;j++)
  25. {
  26. if(s[j]==ch[i])x++;
  27. }
  28. }
  29. if(x==l2)printf("found\n");
  30. else printf("not found\n");
  31. }
  32. }
  33.  
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
Standard output is empty