boolean f(boolean A, boolean B, boolean C, boolean D, boolean E)
{
if (A)
{
k();
if (B)
{
m();
if (C)
{
n();
if (D)
{
p();
if (E)
{
q();
return true;
}
else
{
r();
return false;
}
}
else
{
s();
return false;
}
}
else
{
t();
return false;
}
}
else
{
v();
return false;
}
}
else
{
w();
return false;
}
}
Probably only by flattening the if
s by evaluating the conditions more than once:
if (A) k(); else w();
if (A && B) m(); else if(A && !B) v();
if (A && B && C) n(); else if (A && B && !C) t();
if (A && B && C && D) p(); else if (A && B && C && !D) s();
if (A && B && C && D && E) q(); else if (A && B && C && D && !E) r();
return (A && B && C && D && E);