Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string drink, sugar;
- cin >> drink >> sugar;
- int drinkCount;
- cin >> drinkCount;
- double sum = drinkCount;
- if (drink == "Espresso") {
- if (sugar == "Without") {
- sum *= 0.90 * 0.65;
- }
- else if (sugar == "Normal") {
- sum *= 1.00;
- }
- else if (sugar == "Extra") {
- sum *= 1.20;
- }
- if (drinkCount > 5) {
- sum *= 0.75;
- }
- }
- else if (drink == "Cappuccino"){
- if (sugar == "Without") {
- sum *= 1.00 * 0.65;
- }
- else if (sugar == "Normal") {
- sum *= 1.20;
- }
- else if (sugar == "Extra") {
- sum *= 1.60;
- }
- }
- else if (drink == "Tea") {
- if (sugar == "Without") {
- sum *= 0.50 * 0.65;
- }
- else if (sugar == "Normal") {
- sum *= 0.60;
- }
- else if (sugar == "Extra") {
- sum *= 0.70;
- }
- }
- if (sum > 15) {
- sum *= 0.8;
- }
- printf("You bought %i cups of %s for %.2f lv.\n", drinkCount, drink.c_str(), sum);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement