Advertisement
nikitakrut58

1dzNum5

Sep 17th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int t,shtor,lamp;
  6.     float time;
  7.     setlocale(LC_ALL, "Russian");
  8.     cout << "введите сколько времени" << endl;
  9.     cin >> time;
  10.     if ((time >= 6.00) && (time <= 18.00)){
  11.         t = 1;
  12.     }
  13.     else {
  14.         t = 0;
  15.     }
  16.     cout << "состояние штор?(1-раздвинуты,0-задвинуты)" << endl;
  17.     cin >> shtor;
  18.     cout << "лампа?(1-вкл,0-выкл)" << endl;
  19.     cin >> lamp;
  20.     if (lamp == 1) {
  21.         cout << "в комнате светло" << endl;
  22.     }
  23.     else {
  24.         if ((shtor == 1) && (t == 1)) {
  25.             cout << "в комнате светло" << endl;
  26.         }else{
  27.             cout << "в комнате темно" << endl;
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement