I have written the code to the following
problem
The output I am getting is correct but still it shows wrong answer.I have read FAQs but still no nuccess.Where I am doing wrong.(I am a new user to codechef and joined today only)
Here is my code
import java.io.*;
class abc
{
public static void main(String args[])
{
try{
String num;
BufferedReader in=new BufferedReader(new FileReader("in.txt"));
BufferedWriter out=new BufferedWriter(new FileWriter("out.txt"));
while((num=in.readLine())!=null)
{
if(Integer.parseInt(num)==42)
break;
else
out.write(num+"\n");
}
in.close();
out.close();
}catch(Exception e)
{
System.out.println("File not found");
}
}
}