Start: Jul, 03, 2019 08:38:00
2019年度暑期短学期第七天 助教场
End: Jul, 04, 2019 23:00:00
Time elapsed:
Time remaining:

Problem_ID: D
Result: Accepted
Time: 3ms
Memory: 1756kB
Author: 2017212212083
In contest: 1292

#include<bits/stdc++.h>

using namespace std;

int n;
string s;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    cin >> n;
    getline(cin, s);
    for (int i = 1; i <= n; ++i) {
        getline(cin, s);
        if (s.find("print ") != string::npos) {
            s.replace(s.find("print "), 6, "print(");
            cout << s << ")\n";
        } else {
            cout << s << "\n";
        }
    }
    return 0;
}