TEST: Need help with solution for problem

hello sir, i tried solving the first problem of easy section , but it is displaying run time error. can you please help me rectify?

#include
 #include
 int main(void)
 { 
int c;
 int x=0; 
while(scanf("n%d", &c))
{
 if(c == 42) 
{ x=-1; }
 else 
{ if(x== -1)
{} 
else
 { printf("%d",c); }
 }
 }
 getch();
 return 0; 
}

type you full code…see first 2 lines…!

Please see the answer to your earlier question I am getting a TLE. Please help. - general - CodeChef Discuss