同路径下生成要求的名字.cpp 和.in,可以把数据存进去。
改下XXX YYY就能用了patpat
只是因为太懒,望天
#include <bits/stdc++.h> using namespace std; string op; int main(){ cin >> op; freopen((op+".cpp").c_str() , "w", stdout); cout<<"/*"<<endl<<"ID: XXXXXXXXXXXXXXX"<<endl; cout<<"PROG: "<<op<<endl; cout<<"LANG: C++"<<endl<<"*/"<<endl; cout<<"#include <bits/stdc++.h>"<<endl<< "using namespace std;"<<endl; cout<<"int main()"<<endl<<"{"<<endl; cout<<" freopen(""+op+".in","+""r","+"stdin);"<<endl; cout<<" #ifndef YYYYY"<<endl; cout<<" freopen(""+op+".out","+""w","+"stdout);"<<endl; cout<<" #endif"<<endl; cout<<"}"<<endl; freopen((op+".in").c_str(), "w", stdout); //cout<<"!!"<<endl; return 0; }