生成数据模板

From axuhongbo, 3 Years ago, written in C++, viewed 377 times.
URL http://axuhongbo.top/paste/view/c231b05f Embed
Download Paste or View Raw
  1. #include<bits/stdc++.h>
  2. #include <unistd.h>
  3. #include <ctime>
  4. #include <time.h>
  5. #include <sys/timeb.h>
  6. using namespace std;
  7. int Rand(int l,int r)//生成【l,r】的数据
  8. {
  9.     return rand()%(r-l+1)+l;
  10. }
  11. int main()
  12. {
  13. //    freopen("data1.out","r",sdtin);
  14. //    freopen("data1.in","w",stdout);
  15.     struct timeb timeSeed;
  16.         ftime(&timeSeed);
  17.         srand(timeSeed.time * 1000 + timeSeed.millitm);//毫秒级时间种子,此部分复制即可
  18.  
  19.     for(int i=1;i<=100000;i++)
  20.     {
  21.  
  22.         printf("%c",Rand(1,26)+'a');
  23.  
  24.     }
  25.  
  26. }
  27.  

Reply to "生成数据模板"

Here you can reply to the paste above

captcha