Advertisement
Malinovsky239

Untitled

Jan 23rd, 2012
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <cstdio>
  2. #include <iostream>
  3. #include <string>
  4. #include <algorithm>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9.     freopen("cond.in", "r", stdin);
  10.     freopen("cond.out", "w", stdout);
  11.  
  12.     int t1, t2;
  13.     string s;
  14.     cin >> t1 >> t2 >> s;
  15.  
  16.     if (s == "freeze")
  17.         cout << min(t1, t2) << endl;
  18.    
  19.     if (s == "heat")
  20.         cout << max(t1, t2) << endl;
  21.  
  22.     if (s == "auto")
  23.         cout << t2 << endl;
  24.  
  25.     if (s == "fan")
  26.         cout << t1 << endl;
  27.  
  28.  
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement