Home > Back-end >  Problem is very afflictive, output about c prime
Problem is very afflictive, output about c prime

Time:11-13

Specific code as shown in figure, the output of prime Numbers between 0-100,
The key is the second judge condition
I can't, I/2.. I/3... I/4,,,,,,,,, can output the answer

CodePudding user response:

First you have to turn code indentation line feed, or looking at it is too bad, the second as if your way for a bit, advice online looking for example to look at

CodePudding user response:

The code is as follows:
 int main () {
int n;
While (cin & gt;> N) {
For (int I=2; i Bool is_su=true;
For (int j=2; j <=I/2; + + j) {
If (I % j==0) {
Is_su=false;
break;
}
}
If (is_su) {
cout }
}
cout }
return 0;
}

CodePudding user response:

N==100, 100 thought prime Numbers
  • Related