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: 4ms
Memory: 1756kB
Author: 2018212212059
In contest: 1292

#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <set>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <deque>
#define clr(a,b) memset(a,b,sizeof(a))
#define ll long long

using namespace std;

const int maxn=1e5+10;
int n;
string s;

int main()
{
	cin>>n;
	getchar();
	while(n--)
	{
		getline(cin,s);
		int len=s.length(),f=0;
		for(int i=0;i<len-5;i++)
		{
			if(s[i]=='p'&&s[i+1]=='r'&&s[i+2]=='i'&&s[i+3]=='n'&&s[i+4]=='t'&&s[i+5]==' ')
			{
				for(int j=0;j<i;j++)cout<<s[j];
				printf("print(");
				for(int j=i+6;j<len;j++)cout<<s[j];
				printf(")\n");
				f=1;
				break;
			}
		}
		if(!f)cout<<s<<endl;
	}
}