Home > Back-end >  Want to ask about 3 layers if nested equivalent form
Want to ask about 3 layers if nested equivalent form

Time:09-28

The code is as follows:
X=1; y=2; Z=3;
If (x==1)
{
If (y==x + 1)
{
If (z==y + 1)
{
Cout & lt; <"X=1, y=2, z=3" & lt; }
}
}
The else
{
.
}
If the above code, there are three layer nested, want to split into its equivalent form, such as the three layer if converted into two layers, or other better way, hope you give advice or comments!

CodePudding user response:

If ((x==1) & amp; & (y==x + 1) & amp; & (z==y + 1))
  • Related