Simple arithmetic trouble

Hello all, I feel dumb for asking this, but what operation would I need to do to show how many bags of garbage my robot is leaving behind? I know subtracting my variables from the total number of bags available gives me the number I can accept.

1
2
3
4
5
6
7
8
9
for(; reg <= 50; reg += reg){
    cout <<"I can only accept " << 50- reg <<  " of your " <<reg <<" bags of garbage. I'll leave the other behind."<< endl;
    }
    for(; met <= 20; met += met){
    cout <<"I can only accept " <<  20 - met << " of your "<< met<<" metal bags of garbage. I'll leave the other  behind."<< endl;
    }
    for(; glass <= 20; glass += glass){
    cout <<"I can only accept " <<  20 - glass << " of your "<<glass<<" bags of garbage. I'll leave the other behind."<< endl;
    }


Topic archived. No new replies allowed.