cin >> cashTendered
如果投标的金额小于要求的金额,我不确定如何循环或重复 a 。
到目前为止,这就是我所拥有的。
if (cashTendered > || == total)
{
cout << "Your change is: $" << fixed << setprecision(2) << change << ".\n\n"
<< "Have a great day!\n\n\n\n\n";
}
else
{
cout << "You did not tender enough money to cover the total cost.\n"
<< "Please enter amount of cash tendered: $";
}
所以现在我希望 if 语句重复直到为真。
有什么建议么?