Advertisement
Guest User

RUbel Vai

a guest
Nov 14th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstring>
  3. using namespace std;
  4. int main()
  5. {
  6. long long int m,n,count=0,p=0;
  7. cin>>n;
  8. for(int i=1;i<=n;i++)
  9. {
  10. cin>>m;
  11. char a[m];
  12. cin>>a;
  13.  
  14. for(int j=0;j<m;j++)
  15. {
  16.  
  17. if(a[j]=='8')
  18. {
  19. count++;
  20. p=j;
  21. break;
  22. }
  23.  
  24. }
  25. if(count==0||m<11)
  26. {
  27. cout<<"No"<<endl;
  28. }
  29. else if(strlen(a)-p>=11)
  30. {
  31. cout<<"YES"<<endl;
  32.  
  33. }
  34. else
  35. {
  36. cout<<"NO"<<endl;
  37. }
  38.  
  39. }
  40.  
  41.  
  42. return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement