Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int t,n,i,j,m;
- char s[110];
- scanf("%d",&t);
- for(i=0; i<t; i++)
- {
- m=0;
- scanf("%d",&n);
- scanf("%s",&s);
- for(j=0; j<n; j++)
- {
- if(s[j]=='8')
- {
- n=n-j;
- break;
- }
- if(s[j]!='8')
- {
- m++;
- }
- printf("%d %d\n",n,m);
- }
- if(n<11 || m==n)
- {
- printf("NO\n");
- }
- else
- {
- printf("YES\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement