Created
December 27, 2013 08:12
-
-
Save hokein/8144021 to your computer and use it in GitHub Desktop.
A random number generator.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdio> | |
#include <cstring> | |
#include <cstdlib> | |
#include <ctime> | |
using namespace std; | |
const int MOD = 10; | |
int main() { | |
freopen("test.txt", "w", stdout); | |
srand((int)time(0)); | |
int T = 1000; | |
cout << T << endl; | |
for (int i = 0; i < T; ++i) { | |
int n = rand()%MOD + 5; | |
cout << n << endl; | |
for (int j = 0; j < n; ++j) | |
cout << rand()%MOD - 5 << " "; | |
cout << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment