mirror of
https://github.com/Hizenberg469/Algorithms-snippets.git
synced 2026-04-19 22:52:23 +03:00
playground updated
This commit is contained in:
31
playground/Stress_Testing/generator.cpp
Normal file
31
playground/Stress_Testing/generator.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int rnd(int a,int b){
|
||||
return a + rand() % ( b - a + 1 );
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]){
|
||||
|
||||
int seed = atoi(argv[1]);
|
||||
|
||||
srand(seed);
|
||||
|
||||
int n = rnd(1,20);
|
||||
|
||||
int k = rnd(20, 40);
|
||||
|
||||
cout << n << ' ' << k << '\n';
|
||||
|
||||
int val = 0;
|
||||
for(int i = 0 ; i < n ; i++ ){
|
||||
|
||||
val = rnd(0,50);
|
||||
|
||||
cout << val << ' ';
|
||||
}
|
||||
|
||||
cout << '\n';
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user