//No.1 #include using namespace std; int main() { setlocale(LC_ALL, "Russian"); cout << "Саакови Давит"; return 0; } //No.2 #include using namespace std; int main() { setlocale(LC_ALL, "Russian"); double a, b; cout << "Введите числа \n"; cin >> a >> b; double sum = a + b; double dif = a - b; double com = a * b; double div = a / b; cout << "Сумма:" << sum << endl; cout << "Разность:" << dif << endl; cout << "Произведение:" << com << endl; if (b != 0) { cout << "Частное:" << div << endl; } return 0; } //No.3 #include using namespace std; int main() { setlocale(LC_ALL, "Russian"); double b; double c; cout << "Введите b и с для уравнения вида bx+c=0" << endl; cin >> b >> c; if (b == 0) cout << "Нет решений" << endl; else cout << "x = " << -c / b; return 0; } //No.4 #include using namespace std; int main() { setlocale(LC_ALL, "Russian"); double a, b, c; cout << "Введите a, b и с для уравнения вида ax^2 + bx + c = 0" << endl; cin >> a >> b >> c; double D = b * b - 4 * a * c; if (a == 0) { if (b == 0) cout << "Неовзможно найти корни" << endl; else cout << "Имеется один корень x = " << -c / b; return 0; } if (D == 0) { cout << "Имеется одинь корень х = " << -b / (2 * a); return 0; } if (D < 0) { cout << "Нет решений" << endl; return 0; } cout << "x1 = " << (-b + sqrt(D)) / (2 * a) << endl; cout << "x2 = " << (-b - sqrt(D)) / (2 * a); return 0; } //No.5 #include using namespace std; int main() { setlocale(LC_ALL, "Russian"); bool day, shtori, lamp; cout << "При вводе ответа используйте 1 для положительного и 0 для отрицательного" << endl; cout << "Сейчас светлое время суток?" << endl; cin >> day; cout << "Штроы открыты?" << endl; cin >> shtori; cout << "Лампа включена?" << endl; cin >> lamp; if (day && shtori || lamp) cout << "В комнате светло" << endl; else cout << "В комнате темно" << endl; return 0; }