Блог пользователя pksingh290

Автор pksingh290, история, 4 года назад, По-английски

hello everyone.i want to know how to save my output file in cpp to submit in ongoing fb hackercup contest .i tried to submit my first sollution but it lead to timeout since i tried to copy paste my output file in a text file .i need your help to submit my sollution.thanks for your help..

  • Проголосовать: нравится
  • -41
  • Проголосовать: не нравится

»
4 года назад, # |
Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

Include these lines in your code:-
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
Although there is no reason I could think for timeout when you copy-paste the output.These lines just takes the input from the file input.txt and stores the output in output.txt.Maybe you need to check your code again.

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Compile it with: g++ filename.txt -o a

Execute and redirect the output with: ./a > output.txt