Home > Back-end >  Beginners (????? ︿??? )
Beginners (????? ︿??? )

Time:12-31

Define a, no reference the type function int fun3 (), and the first three prime Numbers, and returns the primes,
(the c + + to do then, mainly is the return value not sure (????? ︿??? ))

CodePudding user response:

For example
Int fun3 () {
Int I, j;
for(i=101; i<1000; I +=2) {//3 digits cycle (ignoring an even number)
for(j=3; J<=I/2; J +=2) {//judgment have 3 digits factor
If (I % j==0) break;
}
If (j> I/2) return the I;//not factor directly return 3 digits
}
return -1;//can't find the return 1
}
Int main () {
Cout}
  • Related