Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- double partyPrice;
- cin >> partyPrice;
- int loveMessageCount, waxRoseCount, keychainCount, caricatureCount, luckySurpriseCount;
- cin >> loveMessageCount >> waxRoseCount >> keychainCount >> caricatureCount >> luckySurpriseCount;
- int totalCount = loveMessageCount + waxRoseCount + keychainCount + caricatureCount + luckySurpriseCount;
- double budget = 0.60 * loveMessageCount + 7.20 * waxRoseCount + 3.60 * keychainCount + 18.20 * caricatureCount + 22.00 * luckySurpriseCount;
- if (totalCount >= 25) {
- budget *= 0.65;
- }
- budget = budget * 0.9 - partyPrice;
- cout.setf(ios::fixed);
- cout.precision(2);
- if (budget >= 0) {
- cout << "Yes! " << budget << " lv left.\n";
- }
- else {
- cout << "Not enough money! " << abs(budget) << " lv needed.\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement