You can't.
If it matters, it needs to be two different conditions.
if (a == b) {
// it was a == b
return true;
}
if (c == d) {
// it was c == d
return true;
}
Note that even so, you won't know if both or just one of these conditions is true.
If you want to know this as well, you'll want an additional if
:
if (a == b && c == d) {
// a == b and c == d
} else if (a == b) {
// just a == b
} else if (c == d) {
// just c == d
}
return (a == b || c == d);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…