蒟蒻写了个东西造数据,但想实现自动化
#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?
就是把上面的代码重复多次,但文件名递增?