It really depends on whether you really need to strictly distinguish between all 8 of those scenarios, but if you still need all 8 of those, I guess you could check each of a, b, and c once, and assign them to booleans instead of repeatedly checking them:
aFlag = (A > 0);
bFlag = (B > 0);
cFlag = (C > 0);
//just A
if (aFlag && !bFlag && !cFlag){//Do something}
//just B
else if (!aFlag && bFlag && !cFlag){//Do something}
//just C
else if (!aFlag && !bFlag && cFlag){//Do something}
//A + B
else if (aFlag && bFlag && !cFlag){//Do something}
//A + C
else if (aFlag && !bFlag && cFlag){//Do something}
//B + C
else if (!aFlag && bFlag && cFlag){//Do something}
//A + B + C
else if (aFlag && bFlag && cFlag){//Do something}
else {//Do something}
This probably isn't much faster, but, at least in my opinion, it seems a bit easier to look at.
I guess you could also change it to some form of nested if statements, rather than a linear series of else-if statements:
if (A > 0) {
if (B > 0) {
if (C > 0) {
//A + B + C
} else {
//A + B
}
} else {
if (C > 0) {
//A + C
} else {
//just A
}
}
} else {
if (B > 0) {
if (C > 0) {
//B + C
} else {
//just B
}
} else {
if (C > 0) {
//just C
} else {
//None
}
}
}
This looks really messy, but it would only do 3 checks total, instead of a possible 7 for your implementation.