Advertisement
Spocoman

Painting Eggs

Sep 21st, 2023
546
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     string size,color;
  8.     cin >> size >> color;
  9.  
  10.     int eggCount;
  11.     cin >> eggCount;
  12.  
  13.     double total =
  14.         (size == "Large" ? (color == "Red" ? 16 : color == "Green" ? 12 : 9) :
  15.             size == "Medium" ? (color == "Red" ? 13 : color == "Green" ? 9 : 7) :
  16.             (color == "Red" ? 9 : color == "Green" ? 8 : 5)) * eggCount * 0.65;
  17.  
  18.     cout << fixed << setprecision(2) << total << " leva." << endl;
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement