Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <cstdlib>
- using namespace std;
- const int MEMBERS = 1000;
- const string ALPHA[] = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};
- int main() {
- srand ( 12345 );
- string tiedosto = "omatesti.in";
- ofstream virta(tiedosto.c_str());
- for (int i = 0; i <= MEMBERS; i++) {
- virta << "A" << " " << i << " " << i << " asd" << endl;
- }
- for (int i = 0; i <= MEMBERS - 1; i++) {
- virta << "R" << " " << "F " << i << " " << i+1 << " relationship" << endl;
- }
- int i1 = 0;
- int i2 = 0;
- for (int i = 0; i <= 5 * MEMBERS; i++) {
- i1 = rand() % (MEMBERS + 1);
- i2 = rand() % (MEMBERS + 1);
- virta << "R" << " " << "K " << i1 << " " << i2 << " random relationship" << endl;
- }
- for (int i = 0; i <= 5 * MEMBERS; i++) {
- i1 = rand() % (MEMBERS + 1);
- i2 = rand() % (MEMBERS + 1);
- virta << "S " << i1 << " " << i2 << endl;
- }
- for (int i = 0; i <= MEMBERS; i++) {
- virta << "F " << i << endl;
- }
- string randnetwork = "";
- for (int i = 0; i <= MEMBERS/2; i++) {
- randnetwork = ALPHA[rand() % 26];
- randnetwork.append(ALPHA[rand() % 26]);
- virta << "N " << randnetwork << endl;
- for (int j = 0; j <= MEMBERS/10; j++) {
- i1 = rand() % (MEMBERS + 1);
- virta << "J " << i1 << " " << randnetwork << endl;
- }
- virta << "P N " << randnetwork << endl;
- }
- for (int i = 0; i <= MEMBERS-1; i++) {
- i1 = rand() % (MEMBERS + 1);
- i2 = rand() % (MEMBERS + 1);
- virta << "I K " << i1 << " " << i2 << endl;
- }
- for (int i = 0; i <= MEMBERS-1; i++) {
- virta << "P P " << i << endl;
- }
- virta << "Q" << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment