Minimum Positive Integer

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.