Advertisement
Guest User

Untitled

a guest
Dec 18th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main(){
  7.   int temperature;
  8.   string flower, stype;
  9.   string res;
  10.   cin >> flower >> temperature >> stype;
  11.  
  12.   // restrictions
  13.   if ((flower != "red" && flower !="blue") || (stype != "wet" && stype != "dry"))
  14.   {
  15.     cout << "bullshit";
  16.     return 0;
  17.   }
  18.  
  19.  
  20.  
  21.  
  22.  
  23.   if (flower == "red")
  24.   {
  25.     if (temperature >= 60)
  26.     {
  27.       if (stype == "wet")
  28.       {
  29.         res = "sunflower";
  30.       }
  31.       else
  32.       {
  33.         res = "tulip";
  34.       }
  35.      
  36.     }
  37.     else
  38.     {
  39.       res ="mush";
  40.     }
  41.   }
  42.   else if (flower == "blue")
  43.   {
  44.     if (temperature >= 50 && temperature <= 75)
  45.     {
  46.       if (stype == "wet")
  47.       {
  48.         res = "tulip";
  49.       }
  50.       else
  51.       {
  52.         res = "sunflower";
  53.       }
  54.      
  55.     }
  56.     else
  57.     {
  58.       res ="mush";
  59.     }
  60.   }
  61.   cout << res;
  62.  
  63.  
  64.  
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement