From 007a0c266173b22b2ed3e2ebf75c6f93a4ee33f3 Mon Sep 17 00:00:00 2001 From: Karol Piotrowski Date: Sun, 24 May 2020 20:32:46 +0000 Subject: [PATCH] =?UTF-8?q?Prze=C5=9Blij=20pliki=20do=20''?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gmo.cpp | 123 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 gmo.cpp diff --git a/gmo.cpp b/gmo.cpp new file mode 100644 index 0000000..9cea8f4 --- /dev/null +++ b/gmo.cpp @@ -0,0 +1,123 @@ +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +string generateValue() { + + char trash[100]; + string x = itoa(((rand() % 10) * 100 + (rand() % 10) *10 + (rand() % 10)),trash,10); + if (x.size() == 2) { + x = "0" + x; + } + else if (x.size() == 1) { + x = "00" + x; + } + + return x; + +} + + +string generateVegetable() { + + string taste = generateValue(); + string colour = generateValue(); + string size = generateValue(); + + return taste + colour + size; + +} + + +void generatePopulation(string * population,int length) { + + int i; + for(i=0;i()); + + for(i=0;i