c++生成数据程序模板
in.cpp:
#include<bits/stdc++.h>
#define random(a,b) rand()%(b-a+1)+a
using namespace std;
const int Case = 10;
void generateData(int t) {
cout << "zifeiy" << endl;
}
int main()
{
srand(time(NULL));
char in[100];
for(int t = 1; t <= Case; t++) {
sprintf(in, "data/%d.in", t);
freopen(in, "w", stdout);
generateData(t);
}
return 0;
}
out.cpp:
#include<bits/stdc++.h>
using namespace std;
const int Case = 10;
int main()
{
char in[100];
for(int t=1; t<=Case; t++)
{
sprintf(in, "data/%d.out", t);
freopen(in, "w",stdout);
sprintf(in, "data/%d.in", t);
freopen(in, "r",stdin);
system("std.exe");
}
return 0;
}