| DontSeeMinusMinus (16) | |||
Struggled with this program for ore than 12 hours straight finally, it seems, at least to me, it's starting to somewhat work. So the program goes like this -> cin >> n // length of first array cin >> a[i] // I enter all numbers First function reads the first array and returns a[i] numbers which are not primes. New array b with the newly found results from the previous function. Second function reads the second array and prints out max divisor of 2 numbers. cin >>4 cin >> a[i] (6986) function one returns 6 9 6 cin >> b[i] (696) function2 returns 3 as the maximum number. The problem is, it returns only 0 for me and the message that one of the numbers is 0. I'd grately appreciate any kind of a help! Thanks in advance! | |||
|
|
|||
| toum (169) | |
|
Your function function() does not return anything. Besides, you can't return an array. You'll have to pass b to function() and copy into it the elements of a[] which are not primes. | |
|
|
|