#include <stdio.h>
char a[100000],c;
int r[100000];
int main()
{
int n,l=0,i,j,s,k,q,d,f=0;
scanf("%d ",&n);
for(i=1;i<=n;i++)
{
f=0;
l=0;
while((c=getchar())!='\n')
a[l++]=c;
if(a[0]!='0')
{
printf("null\n");
}
else
{
if(a[1]!='x'&&a[1]!='X')
{
printf("null\n");
}
else
{
int flag=0;
for(j=2;j<l;j++)
{
d=l-j-1;
if('0'<=a[j]&&a[j]<'9')
r[d]=a[j]-'0';
else if('a'<=a[j]&&a[j]<='f')
r[d]=a[j]-87;
else if('A'<=a[j]&&a[j]<='F')
r[d]=a[j]-55;
else
{
printf("null\n");
flag=1;
break;
}
if(d==0)
s=r[d];
else
{
q=1;
for(k=1;k<=d;k++)
q*=16;
s=r[d]*q;
}
f+=s;
}
if(flag==0)
printf("%d\n",f);
}
}
}
return 0;
}
여기서 runtime error이 왜 나는건가요