• Помогите выполнить задание,пожалуйста!Ответ пришлите файлом

    question img
    question img

Ответы 1

  • 1. Смотри во вложении.Язык C++.2. #include <iostream>#include <cmath>using namespace std;int main() {    double a, b, c, x1, x2, x0, D;    cin >> a >> b >> c;     if (a == 0 && b == 0 && c == 0){       cout << "x - любое." << endl;       return 0;       }          else if(a == 0 && b == 0){          cout << "Нет решений." << endl;          return 0;          }          else if (a == 0){          x1 = -c/b;          cout << x1 << endl;         return 0;          }       D = pow(b,2)-4*a*c;       if(D > 0){            D = sqrt(D);            x1 = (-b-D)/(2*a);            x2 = (-b+D)/(2*a);            cout << x1 << endl << x2;            }            else if(D == 0){                 x0 = -b/(2*a);                 cout << x0 << endl;                  return 0;                 }                 else if(D != 0) {                      cout << "Нет решений." << endl;                      return 0;                      }    } 3. #include <iostream>using namespace std;int main(){    int *arr;     int size;    cout << "Введите количество чисел в массиве: ";    cin >> size;    if (size <= 0) {        cout << "Некорректный ввод." << endl;    }    arr = new int[size];    for (int i = 0; i < size; i++) {        cin >> arr[i];    }    int max = arr[0];    for (int i = 1; i < size; i++) {        if (arr[i] > max) {            max = arr[i];        }    }    cout << "Наибольший элемент массива: " << max << endl;}
    answer img
    • Автор:

      noelr4dg
    • 6 лет назад
    • 0
  • Добавить свой ответ

Войти через Google

или

Забыли пароль?

У меня нет аккаунта, я хочу Зарегистрироваться

How much to ban the user?
1 hour 1 day 100 years