随机数
View Code
1 #include <iostream>
2 #include <algorithm>
3 #include <fstream>
4 #include <ctime>
5 #define mx 200000
6 using namespace std;
7 ofstream fout("fin.txt");
8 int main()
9 {
10 int i,n;
11 double a,b,temp;
12 srand((unsigned)time(NULL));
13 cin>>n;
14 fout<<n<<endl;
15 for(i=0;i<n;i++)
16 {
17 a=rand();//%mx;
18 //if(a<b) {temp=b;b=a;a=temp;}
19 fout<<a<<endl;
20 }
21 return 0;
22
23 }