From 66a2ff0a741d6403b1dfc1c3e4f5b3dd6ee1c312 Mon Sep 17 00:00:00 2001 From: Nathalia Date: Wed, 2 Oct 2019 12:27:40 -0300 Subject: [PATCH 1/2] Adding intersection between two integer arrays --- .../intersection.cpp | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Intersection of two Integer arrays/intersection.cpp diff --git a/Intersection of two Integer arrays/intersection.cpp b/Intersection of two Integer arrays/intersection.cpp new file mode 100644 index 0000000..b6132ec --- /dev/null +++ b/Intersection of two Integer arrays/intersection.cpp @@ -0,0 +1,56 @@ +#include +using namespace std; + +int main(){ +srand(time(NULL)); +int tam1 = 6, tam2 = 10, cont = 0, i, j; +int array1[tam1], array2[tam2]; +int intersection[tam1]; /*I am using the size of the smallest array because it would be impossible to have more than that as an INTERSECTION.*/ + +for(i = 0; i Date: Sun, 6 Oct 2019 00:42:04 -0300 Subject: [PATCH 2/2] Adding intersection between two integer arrays in C++ --- Intersection of two Integer arrays/intersection.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Intersection of two Integer arrays/intersection.cpp b/Intersection of two Integer arrays/intersection.cpp index b6132ec..acdd25d 100644 --- a/Intersection of two Integer arrays/intersection.cpp +++ b/Intersection of two Integer arrays/intersection.cpp @@ -1,3 +1,7 @@ +// LANGUAGE: C++ +// AUTHOR: Nathalia-b +// GITHUB: https://github.com/nathalia-b + #include using namespace std;