- 2

Can someone convert this code to c++

The first line of input is a single number N, which specifies how many positive integers will be input to my program.N lines of input follow ,with a single positive integer on each line .You can assume each integer is greater than 2. https://code.sololearn.com/cYn0886DOjQa/?ref=app

26th May 2022, 3:22 AM
Siyabonga Mbendane
Siyabonga Mbendane - avatar
3 Answers
0
If you receive a number x, you will have to check first if x is prime, and then whether x−2 or x+2 is prime. E.g. input : 2 4 9 output : false false
26th May 2022, 3:31 AM
Siyabonga Mbendane
Siyabonga Mbendane - avatar
26th May 2022, 9:38 AM
Siyabonga Mbendane
Siyabonga Mbendane - avatar
0
Finally figured it out
26th May 2022, 9:39 AM
Siyabonga Mbendane
Siyabonga Mbendane - avatar