#include <iostream>
#include <string>
#include <fstream>
#include <cstring>
#include <iomanip>
#include <cstdlib>
#include <ctime>
using namespace std;
int n;
string name;
string dat(int x){
string tmp = "";
tmp += x / 100 + '0';
tmp += x / 10 % 10 + '0';
tmp += x % 10 + '0';
return tmp;
}
int random(int minn,int maxn){ //随机选择minn到maxn之间的数,误差无伤大雅
return rand() % (maxn - minn) + minn;
}
int main() {
srand((unsigned)time(NULL));
cout << "请输入数据前缀:\n";
cin >> name;
cout << "请输入生成数据点个数";
cin >> n;
n %= 101;
for(int i = 1; i <= n; i++){
ifstream ipt((name + dat(i) + ".in").c_str());
ofstream opt((name + dat(i) + ".out").c_str());
}
return 0;
}
开发环境是mac的codeRunner
实测fstream跑的起来
Appstore上买的正版
他给我报错说
LLVM ERROR: Program used external function '___dso_handle' which could not be resolved!
各位帮忙调下谢谢