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