C++ срочно надо, по заданию!

Ответы
#include <iostream>
#include <vector>
using namespace std;
const double EPS = 1e-7;
const double errCode = -1e9-7;
double F(double &a_, double &b_, double &c_, double &x_){
if(a_ < 0 && abs(x_) > EPS)
return a_ * x_ * x_ + b_ * b_ + x_;
if(a_ > 0 && abs(x_) <= EPS && (x_- c_) != 0)
return x_ - a_ / (x_ - c_);
if(c_ != 0)
return 1 + x_ / c_;
return errCode;
}
void solve(){
double a, b, c, x_start, x_end, dx;
cout << "a = ";
cin >> a;
cout << "b = ";
cin >> b;
cout << "c = ";
cin >> c;
cout << "start value = ";
cin >> x_start;
cout << "end value = ";
cin >> x_end;
cout << "step = ";
cin >> dx;
if((x_start < x_end && dx < 0) || (x_start > x_end && dx > 0) || (x_start != x_end && abs(dx) <= EPS)){
cout << "Incorrect input data: infinite interval loop";
return;
}
vector<pair<double, double>> resTable;
for(double x = x_start; x <= x_end; x += dx){
double res = F(a, b, c, x);
if(abs(res - errCode) <= EPS){
cout << "Incorrect input data: division by zero!";
return;
}
resTable.push_back({x, res});
}
cout << "\nx\tF\n";
for(auto &i: resTable)
cout << i.first << "\t" << i.second << "\n";
}
int main(){
solve();
}