LOJ # 3 Copycat solution to a problem

Please use the following code :( C ++ (NOI) compile-time submission)

#include <bits/stdc++.h>
using namespace std;
int main() {
    freopen("copycat.in", "r", stdin);
    freopen("copycat.out", "w", stdout);

    int quantity;
    cin >> quantity;
    string a;
    for (int i = 1; i <= quantity; i++) {
        cin >> a;
        cout << a << endl;
    }

    return 0;
}

I wrote about the recording process of solving the problem of it, to say really long story.
This question would have been the third question loj of pure test file used to read and write. Then I see the problem when there is a problem face "Note the use of file input and output, instead of the standard input and output.", Cause I've been using fin and fout read and write, int, and long long used in the ninth point burst memory. Tune for a long time, a sample run properly on the machine, but after the test machine inexplicable wa, a point at all.
Really ignorant force, so to see the solution to a problem under written by someone else, pleasant to the eye is a freopen, I thought stream console redirection can not say ...
So into this, read into a variable of type string to be used, because the first data amount is three subtasks <= 10 ^ 1000, will burst with a long long memory.

Guess you like

Origin www.cnblogs.com/kozumi/p/12612025.html