Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In programming contests like Google CodeJam, Facebook Hacker Cup, each question is provided with an input file for testing one's code for that program. I get struck at this point only.

I don't understand whether that input file should be read by my program or it is just for testing the correctness of my program for various test cases given in that input file and I can copy past each test case given in the input file one by one manually and see whether the output provided by my program is right or wrong.

It would be very helpful for me if anyone who has been actively participating in such competitive contests can share their views.

share|improve this question
I didn't try any code contest in your list but usually the data file is feed in by command line piping or redirection and scanf (C/C++) is enough to handle the input. – Codism Jan 9 '13 at 16:30
up vote 9 down vote accepted

You need to write code to read that file. When you submit your program, it will be tested against other unpublished data files in the same format.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.