summaryrefslogtreecommitdiff
path: root/write_data.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'write_data.cpp')
-rw-r--r--write_data.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/write_data.cpp b/write_data.cpp
new file mode 100644
index 0000000..ebd655b
--- /dev/null
+++ b/write_data.cpp
@@ -0,0 +1,18 @@
+
+#include "statistics.h"
+
+using namespace std;
+
+void write_data(const char *filename, unsigned int N, unsigned int M)
+{
+ srand(time(0));
+
+ ofstream out;
+ out.open(filename);
+
+ for (int i = 0; i < N; i++) {
+ out << rand() % (M+1) << endl;
+ }
+
+ out.close();
+}