मैं ग नया हूँ ++ और मैं मूल्य 50 से शुरू होने वाले कारों को बढ़ाने के लिए, लेकिन केवल एक की वृद्धि करता है, तो youdamage cardamage से greaters है कोशिश कर रहा हूँ। मैं चाहता हूं कि अगली बार लूप के माध्यम से कारें अपना मूल्य धारण करें। मुझे लगता है कि इसका मतलब बनता है।द्वारा संदर्भित चर बढ़ाने के लिए कैसे 1
int Power (int &car);
int main(){
int car = 50;
// ...
// ...
// ...
int carDamage = 0;
int yourDamage = 0;
// pick a random number between 1 to 50
yourDamage = 0 + rand() % (50 - 0 + 1);
carDamage = 0 + rand() % (50 - 0 + 1);
cout << "You hit the car and cause damage of: " << carDamage << endl;
cout << "The car hits you and causes damage of: " << yourDamage << endl;
cout << endl;
if(carDamage < yourDamage)
{
cout << "You win" << endl;
cout << "You gain strength." << endl;
cout << endl;
int car = car + 1;
}
else
{