FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sort/generalRandom.cpp at master · yangxt225/sort · GitHub
yangxt225
/
sort
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
3
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
sort
/
generalRandom.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
22 lines (15 loc) · 328 Bytes
Breadcrumbs
sort
/
generalRandom.cpp
Copy path
File metadata and controls
22 lines (15 loc) · 328 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//
产生1000以内的随机数
//
#include <iostream>
#
include
<
fstream
>
#
include
<
stdlib.h
>
#
define
NUM
30000
std::ofstream
fout
(
"
data.in
"
);
int
main
()
{
srand
((
unsigned
)
time
(
NULL
));
//
用时间做种,每次产生随机数不一样
for
(
int
i=
0
; i<
NUM
; ++i)
{
fout <<
rand
() % (
100000
-
1
)+
1
<<
"
"
;
}
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL