ok, put in an input of 7 then 6(or any input starting with a prime number)
the program gets terminated and I cannot seem to figure out why.
the expected output for the input 7 6 is supposed to be:
7 7
2 6
explanation of output:
because 7 is prime we check if there is a box of type node2 with the value 7,
because there isn't we create one.
then on that same line of node2 we check if there is a node with the value 7,
because there isn't we create one.
then the number 6 isn't prime so we find its smaller prime divisor which is 2,
we check if there is a node2 with the value 2
because there isn't we create one
then on the same line of the node2 with the value 2 we check if there is a node with the value 6,
because there isn't we create one.
I believe my pronlem might be in the function put_in_node
but I'm not 100% sure.
thanx for the help please let me know if something isn't clear or if you have any questions
p.s to end output enter -1
p.p.s
an example of an input that does work in the program is
input:4 7 5 2 -1
output: 2 2 4
5 5
7 7
link to the code:
http://cpp.sh/9jt2b