I ran this code on my compiler,and it worked just fine.But the codechef online IDE isnt taking any of my scanf values ? Why is that?

#include<math.h>

int digits(long x);

int main(void) {

// your code goes here

```
int t;
printf("Enter the number of text cases :");
scanf("%d",&t);
```

long n[1100];

if(t>=1 && t<=1000)

{

for(int i=0;i<t;i++)

{

printf(“Enter the digit :”);

scanf(" %ld",&n[i]);

```
}
}
int ctr;
```

long sum=0;

long temp;

for(int i=0;i<t;i++)

{

if(n[i] >=1 && n[i]<=1000000)

```
{ temp=n[i];
sum=0;
ctr= digits(n[i]);
for(int j=0;j<ctr;j++)
{
sum+=temp%10;
temp=temp/10;
}
printf(" %ld\n",sum);
}
}
return 0;
```

}

int digits(long n)

{

int ctr=0;

while(n !=0)

```
{ n=n/10;
ctr++;
}
return(ctr);
```

}