Please help me test my program
#include <stdio.h>
#include <string.h>
int main()
{
int t,n;
int stk[20003], cur, srt;
char proc[20001];
int i,idx,cnt,scnt,len;
t = 10;
while ( t-- )
{
scanf("%d", &n);
scanf("%s", proc);
len = strlen(proc);
idx = 0;
srt = stk[idx++] = n;
scnt = cnt = 0;
for ( i = 0; i < len && idx ; i++ )
{
if ( proc[i] == '0' )
idx--;
else
{
cur = stk[--idx] / 2;
cnt++;
stk[idx++] = cur;
stk[idx++] = cur;
if ( cur < srt )
{
srt = cur;
scnt = cnt;
}
}
}
printf("%d\n", scnt);
}
return 0;
}