[gcj] Whats the way I should write the code?

2013-04-01 Thread Chandra Sekhar
Hi All, I am going to participate Google Code JAM 2013. So before that I thought to practice a bit. I found the inputs are given in a file and the output is expected in a file only. So my question is do I need to write some IO operations to read the question from file and after calculating

Re: [gcj] Whats the way I should write the code?

2013-04-01 Thread ZHANG Xiongqi, Parker
I think you can use System.setIn(new FileInputStream("code_jam_input_file.txt")); System.setOut(new PrintStream("code_jam_output_file.txt")); These two line should let you read from txt file and write to a txt file. Parker On 2013/3/30 21:37, Chandra Sekhar wrote: Hi All, I am going to p

Re: [gcj] Whats the way I should write the code?

2013-04-01 Thread Axel Freyn
I think you can do it as you want (but I have NOT read the rules of code jam - if you have to upload your code, it might be required to read the input-file exactly as specified) However, reading from a file (and writing to the other file) will be far easier when the files are longer (for example,

RE: [gcj] Whats the way I should write the code?

2013-04-01 Thread Aby Paul
now to run the tests -$ ./a.out < input.txt 2>output.txt > Date: Tue, 2 Apr 2013 01:25:30 +0800 > From: zhangxion...@gmail.com > To: google-code@googlegroups.com > Subject: Re: [gcj] Whats the way I should write the code? > > I think you can use > > System.s