Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main() {
- string size,color;
- cin >> size >> color;
- int eggCount;
- cin >> eggCount;
- double total =
- (size == "Large" ? (color == "Red" ? 16 : color == "Green" ? 12 : 9) :
- size == "Medium" ? (color == "Red" ? 13 : color == "Green" ? 9 : 7) :
- (color == "Red" ? 9 : color == "Green" ? 8 : 5)) * eggCount * 0.65;
- cout << fixed << setprecision(2) << total << " leva." << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement