fork(1) download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. string color="";
  8. cout<<"what is the color of the seed? please either enter blue or red!: \n";
  9. cin >> color;
  10.  
  11. int temp;
  12. cout<<"what is the temperture? :\n";
  13. cin >> temp;
  14.  
  15. string soil="";
  16. cout<<"what kind of the soil? please either enter wet or dry! :\n";
  17. cin >> soil;
  18.  
  19. if (color == "red")
  20. {
  21. if (temp >= 75)
  22. {
  23. if (soil=="wet")
  24. {
  25. cout <<"you get yourself a sunfolower :\n";
  26. }
  27. else if (soil=="dry")
  28. {
  29. cout <<"you get yourself a dendelion :\n";
  30. }
  31. }
  32. else
  33. {
  34. cout <<"Shit, you have a mushroom now! :\n";
  35. }
  36. }
  37.  
  38. else if (color=="blue")
  39. {
  40. if (temp >= 60 && temp <= 70)
  41. {
  42. if (soil=="wet")
  43. {
  44. cout <<"you get yourself a dendelion :\n";
  45. }
  46. else if(soil=="dry")
  47. {
  48. cout <<"you get yourself a sunfolower :\n";
  49. }
  50. }
  51. else{
  52. cout <<"Shit, you have a mushroom now! :\n";
  53. }
  54.  
  55. }
  56.  
  57. return 0;
  58.  
  59. }
  60.  
Success #stdin #stdout 0s 3476KB
stdin
blue 50 wet
stdout
what is the color of the seed? please either enter blue or red!: 
what is the temperture? :
what kind of the soil? please either enter wet or dry! :
Shit, you have a mushroom now! :