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, fuel;
- cin >> budget >> fuel;
- string day;
- cin >> day;
- double sum = 2.10 * fuel + 100;
- if (day == "Saturday") {
- sum *= 0.90;
- }
- else {
- sum *= 0.80;
- }
- if (budget >= sum) {
- printf("Safari time! Money left: %.2f lv.\n", budget - sum);
- }
- else{
- printf("Not enough money! Money needed: %.2f lv.\n", sum - budget);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement