Today…I came learnt abt freopen …so how and where can i use it ??
Suppose the question is this…
Problem Code:FLOW001
so
can i use…
#ifndef ONLINE_JUDGE
freopen(“input.txt”,“r”,stdin);
freopen(“output.txt”,“w”,stdout);
#endif
in this ??
Today…I came learnt abt freopen …so how and where can i use it ??
Suppose the question is this…
Problem Code:FLOW001
so
can i use…
#ifndef ONLINE_JUDGE
freopen(“input.txt”,“r”,stdin);
freopen(“output.txt”,“w”,stdout);
#endif
in this ??
There are 2 ways of I/O in CP:
main()
and the rest of the code remains unchanged.freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);