There is an integer except 5 plus 3, 3 plus 2, and 2 plus 1 to obtain the minimum positive integer that meets the conditions.
Then while (1)
1 represents a constant expression, which is never equal to 0.
Therefore, the loop continues.
UnlessYou can abort a loop of similar statements, such as break.
# Include <iostream>
Using namespace STD;
Int main ()
{Int x = 1;
While (1)
{
If (X % 5 = 3 & X % 3 = 2 & X % 2 = 1)
{X ++; break ;}
}
Cout <x <Endl;
System ("pause ");
Return 1;
}
# Include <iostream>
Using namespace STD;
Int main ()
{Int x = 1;
While (1)
{If (X % 5 = 3 & X % 3 = 2 & X % 2 = 1)
{Break ;}
X ++;
}
Cout <x <Endl;
System ("pause"); return 1;
}
Minimum Positive Integer (continued) Acceleration
# Include <iostream>
Using namespace STD;
Int main ()
{
Int x = 3;
While (1)
{
If (X % 3 = 2 & X % 2 = 1) break;
X + = 5;
}
Cout <x <Endl;
System ("pause ");
Return 0;
}
Minimum Positive Integer