标签:
#include<iostream> #include<time.h> #include<cstdio> #include<stdlib.h> using namespace std; int main() { freopen("rand.txt","w",stdout); long long a,b,n,cou;//cou:数据个数; cin>>a>>b>>cou; srand(time(NULL)); for(long long i=1;i<=cou;i++) { n=rand()%(b-a+1)+a; cout<<n<<‘ ‘; } fclose(stdout); system("rand.txt"); }
标签:
原文地址:http://www.cnblogs.com/gbygby/p/4927538.html