Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- double dayCash, dayProfit, cost, giftPrice;
- cin >> dayCash >> dayProfit >> cost >> giftPrice;
- double total = (dayCash + dayProfit) * 5 - cost;
- if (total >= giftPrice) {
- printf("Profit: %.2f BGN, the gift has been purchased.", total);
- }
- else {
- printf("Insufficient money: %.2f BGN.", giftPrice - total);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement