WRONG ANSWER

wrong-answer

#1

#include<stdio.h>
int main()
{
int a[10],i,t;
int count=0;
for(i=0;i<5;i++)
scanf("%d",&a*);
for(i=0;i<5;i++)
{
if(a*>=1 && a*<100)
count++;
else
return 0;
}
if(count==5)
{
for(i=0;i<5;i++)
{
if(a*==42)
{
for(t=0;t<i;t++)
printf("%d
",a[t]);
}
}
}
else
return 0;
return 0;
}

plz help me i am getting wrong answer on codechef compiler while i m getting correct output on my system. I m unable to fix the bug.Need help Problem:: Life and the universe


#2

bro you have to take input such that if it encounter 42.you have to stop taking more inputs … and you are taking input for 5 numbers only …
otherwise you can look at my solution …http://www.codechef.com/viewsolution/2498498