Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int randomGenerate(int n)
- {
- int rnd;
- //srand(time(NULL));
- rnd = rand() % n;
- return rnd;
- }
- int main()
- {
- srand(time(NULL));
- int rnd_n, rnd_d;
- rnd_n = randomGenerate(1000);
- cout<<rnd_n<<"\n";
- for(int i = 0; i < rnd_n; i++)
- {
- cout<<randomGenerate(100)<<" ";
- }
- cout<<"\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement