what's the problem with my code

#include<stdio.h>
int main()
{
int n,ld[n],wr[n],p1[n],p2[n],i,a,temp;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d,%d",&p1[i],&p2[i]);
if(p1[i]>p2[i])
{
ld[i]=p1[i]-p2[i];
wr[i]=1;
}
else
{
ld[i]=p2[i]-p1[i];
wr[i]=2;
}
}
for(i=0;i<n-1;i++)
{
if(ld[i]>ld[i+1])
{
temp=ld[i];
a=i;
}
else
{
temp=ld[i+1];
a=i+1;
}
}
printf("%d %d",&temp,&w[a]);
return 0;
}

As given, it’s unreadable. That’s because you didn’t indent it to clue the editor into treating it as code. The 101/010 button is there to do that job.

It would probably be better anyway to give a link to your submitted solution: https://www.codechef.com/viewsolution/19886193

You may have the same problem as I talked about in this answer: https://discuss.codechef.com/questions/133140/i-m-getting-correct-output-on-my-laptop-but-showing-wrong-answer-on-codechef-tlg-problem?page=1#134203