Home > Back-end >  Leaders, the program what went wrong
Leaders, the program what went wrong

Time:06-10

CodePudding user response:

Run out, you also don't say you want to do, who knows what's the problem

CodePudding user response:

reference 1st floor qq_45798109 response:
run out, who also don't say you want to do, you know what's the problem with

Output all prime Numbers within 100, full five prime line breaks

CodePudding user response:

refer to the second floor qq_45744248 response:
Quote: refer to 1st floor qq_45798109 response:
run out, who also don't say you want to do, you know what's the problem with

Output all prime Numbers within 100, full five prime line breaks

So the question is what? Next to a previous post, the CSDN BBS newbie guide

CodePudding user response:

reference wowpH reply: 3/f
Quote: refer to the second floor qq_45744248 response:

Quote: refer to 1st floor qq_45798109 response:
run out, who also don't say you want to do, you know what's the problem with

Output all prime Numbers within 100, full five prime line breaks

So the question is what? Next to a previous post, the CSDN BBS newbie guide

See a problem,,,, I am blind,

CodePudding user response:

About others you'd better stick out for you to change the original program code
 # include & lt; stdio.h> 
#include
Bool isPrime (int n) {
If (n & lt; 2) return 0;
For (int I=2; i <=(int) SQRT (n); + + I)
If I (n %==0)
return false;
return true;
}
Int main () {
int count=0;
For (int I=2; i <100; + + I) {
{if (isPrime (I))
Printf (" % d ", I);
count++;
If (count==5) {
printf("\n");
Count=0;
}
}
}
return 0;
}

CodePudding user response:

Put a=0, the second loop outside, namely the second cycle, before the first layer in the loop,

Or put in the second cycle if add a break, or out of the second cycle,

CodePudding user response:


I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html