Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main() {
- int guest;
- cin >> guest;
- double envelope, budget;
- cin >> envelope >> budget;
- double sum = guest * envelope;
- if (guest >= 10 && guest <= 15) {
- sum *= 0.85;
- }
- else if (guest > 15 && guest <= 20) {
- sum *= 0.80;
- }
- else if (guest > 20) {
- sum *= 0.75;
- }
- sum += budget / 10;
- if (budget >= sum) {
- cout << "It is party time! " << fixed << setprecision(2) << budget - sum << " leva left.\n";
- }
- else {
- cout << "No party! " << fixed << setprecision(2) << sum - budget << " leva needed.\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement