造数据代码

· · 个人记录

#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;
string file(int n, string io);

//可修改数据名
string name = "data", in = ".in", out = ".out";
void work(int z);
random_device rd; 
mt19937 gen(rd());
ofstream rout, wout;

string getPath(int n, string io) {
    string id = to_string(n);
    string filename = name + id + io;
    return filename;
}
ll brand() {
    uniform_int_distribution<ll> dist(0, numeric_limits<ll>::max());
    return dist(gen);
}                                               
double drand() {
    normal_distribution<double> dist(0.0, 3.0);
    return dist(gen);
}
int main() {
    for (int z = 1; z <= 10; z++) { //可修改次数
        remove(getPath(z, in).c_str()), rout.open(getPath(z, in), ios_base::app);   
        remove(getPath(z, out).c_str()), wout.open(getPath(z, out), ios_base::app); 
        work(z);                                                                    
        cout << "data " << z << " succeed!" << endl;                                
        rout.close(), wout.close();                                                 
    }
}
//可修改代码
void work(int z) {

    return;
}