Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cmath>
- using namespace std;
- //output Ако бюджета е достатъчен - "Hey, you have a great garden with << flowersNumber << " " << flowers << " and " << ...
- int main()
- {
- string flowers;
- int flowersNumber;
- int budget;
- cin >> flowers >> flowersNumber >> budget;
- double flowerPrice = 0.0;
- double discount = 0.0;
- int roses;
- if (flowers == "Roses")
- flowerPrice = 5;
- else if (flowers == "Dahlias")
- flowerPrice = 3.80;
- else if (flowers == "Tulips")
- flowerPrice = 2.80;
- else if (flowers == "Narcissus")
- flowerPrice = 3;
- else if (flowers == "Gladious")
- flowerPrice = 2.50;
- if (flowers == "Roses" && roses >= 80)
- discount = flowerPrice * 0.2;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment