Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- double budget, towel, discount;
- cin >> budget >> towel >> discount;
- double umbrella = towel / 3 * 2;
- double flipFlops = umbrella * 0.75;
- double beachBag = (towel + flipFlops) / 3;
- double sum = (towel + umbrella + flipFlops + beachBag) * (100 - discount) / 100;
- printf("Annie's sum is %.2f lv. ", sum);
- if (budget >= sum) {
- printf("She has %.2f lv. left.", budget - sum);
- }
- else {
- printf("She needs %.2f lv. more.", sum - budget);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement