0分求助
查看原帖
0分求助
638141
Literally楼主2023/1/28 15:11
#include <iostream>
#include <cstring>
using namespace std;
string title[1005];
int main(){
    int t,n,m;
    string freopen,answer;
    bool flag;
    cin>>t>>n>>m;
    for(int i=1;i<=n;i++){
        cin>>title[i];
    }
    for(int i=1;i<=n;i++){
        flag=1;
        for(int j=1;j<=2*m;j++){
            cin>>freopen;
            if(j%2==1){
                answer="freopen(\""+title[((j-1)/2)+1]+".in\",\"r\",stdin);";
            }else{
                answer="freopen(\""+title[((j-1)/2)+1]+".out\",\"w\",stdout);";
            }
            if(freopen.substr(0,10)=="//freopen(" && freopen[freopen.size()-1]==';' && freopen[freopen.size()-2]==')' & flag==1){
                cout<<"Wrong file operation takes you to your ancestors along with your 3 years' efforts on OI."<<endl;
                flag=0;
            }else if(freopen!=answer && flag==1){
                cout<<"Good luck and have fun."<<endl;
                flag=0;
            }else{
            }
        }
        if(flag){
            cout<<"PION2202 RP++."<<endl;
        }
    }
    return 0;
}
2023/1/28 15:11
加载中...