码迷,mamicode.com
首页 > 其他好文 > 详细

数据生成器

时间:2018-02-26 21:47:31      阅读:410      评论:0      收藏:0      [点我收藏+]

标签:getchar   math   algo   ring   数据   iostream   display   tran   using   

技术分享图片
 1 #include<iostream>
 2 #include<cstdio>
 3 #include<cmath>
 4 #include<cstdlib>
 5 #include<ctime>
 6 #include<cstring>
 7 #include<algorithm>
 8 #include<vector>
 9 #include<queue>
10 #define inf 2139062143
11 #define ll long long
12 #define MAXN 151010
13 using namespace std;
14 inline int read()
15 {
16     int x=0,f=1;char ch=getchar();
17     while(!isdigit(ch)) {if(ch==-) f=-1;ch=getchar();}
18     while(isdigit(ch)) {x=x*10+ch-0;ch=getchar();}
19     return x*f;
20 }
21 int n,m,T;
22 char s1[30],s2[30];
23 string a="file-name",b=".in",c=".out";
24 void trans(int x)
25 {
26     int i,j;
27     for(i=0;i<a.length();i++) s2[i]=s1[i]=a[i];
28     if(x<10) s2[i]=s1[i]=0,i++,s2[i]=s1[i]=x+0,i++;
29     else s2[i]=s1[i]=1,i++,s1[i]=s2[i]=0,i++;
30     for(j=0;j<b.length();j++) s1[j+i]=b[j];
31     for(j=0;j<c.length();j++) s2[j+i]=c[j];
32 }
33 int main()
34 {
35     srand(time(0));
36     for(int t=1;t<=10;t++)
37     {
38         n=300,m=25000-rand()%15,T=40000-(rand()==2333);
39         trans(t);
40         freopen(s1,"w",stdout);
41     }
42 }
View Code

 

数据生成器

标签:getchar   math   algo   ring   数据   iostream   display   tran   using   

原文地址:https://www.cnblogs.com/yyc-jack-0920/p/8475530.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!