Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "rus");
- int t; //Время суток
- int tl;//включенная лампа
- int sh; //Штора
- int x;
- cout << "Введите час\n";
- cin >> t;
- if ((t > 24) || (t < 0)) { cout << "Введи нормальное время\n"; }
- else
- {
- cout << "Штора открыта или нет (1-да 0-нет)\n";
- cin >> sh;
- cout << "Работает ли лампа (1-да 0-нет)\n";
- cin >> tl;
- if ((t < 20) and (t > 6)) { x = 1; }
- else { x = 0; }
- if (((x == 1) and (sh == 0)) || (tl = 1)) { cout << "В комнате светло"; }
- else { cout << "В комнате темно"; }
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement