#include<stdio.h>
#include<cstdlib>
#include<string>
#include<fstream>
#include<ctime>
#include<windows.h>
using namespace std;
const int mod = 1e6;
int main()
{
srand(unsigned(time(NULL)));
ofstream in[100]; //一个输出流数组
ofstream out[100];
for(int i = 1; i <=10 ; i++)
{
string index = to_string(i); //将i转换为string型
string strIn = index + ".in"; //输入数据文件名
string strOut = index + ".out"; //输出数据文件名
in[i].open(strIn,ios::out);
out[i].open(strOut,ios::out);
}
for(int i=1;i<=10;i++)
{
int a=rand()%mod+1;
int b=rand()%mod+1;
in[i]<<a<<" "<<b<<endl;
out[i]<<b<<endl;
}
return 0;
}
06-12
1739
04-12