Advertisement
AKIB37

Untitled

Apr 18th, 2020
527
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int t,n,i,j,m;
  5. char s[110];
  6. scanf("%d",&t);
  7. for(i=0; i<t; i++)
  8. {
  9. m=0;
  10. scanf("%d",&n);
  11. scanf("%s",&s);
  12. for(j=0; j<n; j++)
  13. {
  14. if(s[j]=='8')
  15. {
  16. n=n-j;
  17. break;
  18. }
  19. if(s[j]!='8')
  20. {
  21. m++;
  22. }
  23. printf("%d %d\n",n,m);
  24. }
  25. if(n<11 || m==n)
  26. {
  27. printf("NO\n");
  28.  
  29. }
  30. else
  31. {
  32. printf("YES\n");
  33.  
  34. }
  35.  
  36. }
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement