### prashant.2k03's blog

By prashant.2k03, 10 years ago,

hello all, i m new to codeforces. i want to ask many of the probems contain this as given constraint input:input.txt output:output.txt can anyone explain what does these refer to ??? do i have to take input from input.txt and produce the output by creating a file output.txt

• -5

 » 10 years ago, # |   +6 usually u work with console (stdin, stdout). Howewer, when author say to use files, u will use files.
 » 10 years ago, # | ← Rev. 2 →   +10 You have to take input from the file named : input.txt and you have to produce output to file named : output.txt , Note that you are not allowed to create output.txt. For every sumbmission you will be provided an already created input.txt and output.txt file. So do not worry about creating it. Just write your contents on it. eg. In C++ : freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);Normally if input and output files are not mentioned then you have to do Input Output from stdin and stdout. For this you do not need to add anything to your code , beucase normal Input Output happens from stdin and stdout.
•  » » 3 years ago, # ^ |   0 Thanks a lot for your help!Struggled in a question thinking which file is missing.....came here and got the solution!
 » 4 months ago, # |   0 Well, Thanks from my side too
 » 7 weeks ago, # |   -12 In C++ Keep the following macro in your code: #define TxtIO freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); In the main function declear it as follows: int main() { TxtIO; /* CODE */ return 0; }