关于批量造数据
查看原帖
关于批量造数据
114530
隐隐约约妖艳楼主2021/2/9 10:20

蒟蒻写了个东西造数据,但想实现自动化

#include<bits/stdc++.h>
#include <fstream>
#include <iostream>
using namespace std;
int main()
{
bool fla=1;
do
{
	system("未命名2.exe > qwq\\3.in");
	system("未命名1.exe <qwq\\3.in >qwq\\3.ans");
	fstream fin;
	fin.open("qwq\\3.ans");
	string ch;
	fin>>ch;
	fin.close();
	cout<<ch;
	if(ch!="S"&&ch!="TQ")
		fla=0;
}while(fla);



return 0;
}

未命名2是生成输入数据的的东西,未命名1是std。
怎么实现1.in自动到n.in?
就是把上面的代码重复多次,但文件名递增?

2021/2/9 10:20
加载中...