数据生成器神报错求大佬帮调
  • 板块灌水区
  • 楼主songhx
  • 当前回复1
  • 已保存回复1
  • 发布时间2022/5/18 21:02
  • 上次更新2023/10/28 01:09:59
查看原帖
数据生成器神报错求大佬帮调
362165
songhx楼主2022/5/18 21:02
#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!

各位帮忙调下谢谢

2022/5/18 21:02
加载中...