Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- double shirtPrice, neededSum;
- cin >> shirtPrice >> neededSum;
- double shortsPrice = 0.75 * shirtPrice;
- double socksPrice = 0.20 * shortsPrice;
- double sneakersPrice = (shirtPrice + shortsPrice) * 2;
- double sum = 0.85 * (shirtPrice + shortsPrice + socksPrice + sneakersPrice);
- if (neededSum <= sum) {
- printf("Yes, he will earn the world-cup replica ball!\nHis sum is %.2f lv.\n", sum);
- }
- else {
- printf("No, he will not earn the world-cup replica ball.\n He needs %.2f lv. more.\n", neededSum - sum);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement