#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;
}
随机生成测试数据
最新推荐文章于 2024-10-22 20:06:03 发布
3091

被折叠的 条评论
为什么被折叠?



