include
int main()
{
int t=0,i,j=0,flag,res;
char str[160],tc;
scanf("%c",&tc);
while(tc!='\n' && tc>=48 && tc<=57)
{
t=t*10 + (tc-48);
scanf("%c",&tc);
}
for(i=0;i {
j=0;
flag=0;
res=0;
gets(str);
if(str[j]=='\0')
printf("%d 1\n",i+1);
else
{
while(str[j]!='\0')
{
if(str[j]=='[')
{
flag++;
res++;
}
if(str[j]==']')
{
flag--;
}
if(flag==0)
break;
j++;
}
if(flag==0 && str[j+1]=='\0')
printf("%d %d\n",i+1,2*res);
}
}
return 0;
}
The above is my code for monkey vine i dont know why i m getting WA plzzz help .....