Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.  
  7.     int T1, T2;
  8.     string Mode;
  9.  
  10.     cin >> T1 >> T2 >> Mode;
  11.    
  12.  
  13.     if (T1 < T2)
  14.     {
  15.         if (Mode == "Heat")
  16.         {
  17.             cout << T2;
  18.         }
  19.  
  20.         else if (Mode == "Freeze")
  21.         {
  22.             cout << T1;
  23.         }
  24.  
  25.         else if (Mode == "Auto")
  26.         {
  27.             cout << T2;
  28.         }
  29.  
  30.         else if (Mode == "Fan")
  31.         {
  32.             cout << T1;
  33.         }
  34.  
  35.     }
  36.  
  37.   else if (T1 > T2)
  38.   {
  39.     if (Mode == "Heat")
  40.         {
  41.             cout << T1;
  42.         }
  43.  
  44.         else if (Mode == "Freeze")
  45.         {
  46.             cout << T2;
  47.         }
  48.  
  49.         else if (Mode == "Auto")
  50.         {
  51.             cout << T2;
  52.         }
  53.  
  54.         else if (Mode == "Fan")
  55.         {
  56.             cout << T2;
  57.         }
  58.  
  59.   }
  60.  
  61.  
  62.     cin.get();
  63.     cin.get();
  64.  
  65.  
  66.  
  67.     return 0;
  68.  
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement