#include "stdafx.h"
#include<stdlib.h>
#define _USE_MATH_DEFINES
#include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;
int main()
{
double a, b, x, dx, f;
cout << left;
cout << "Input a:";
cin >> a;
cout<< "Input b:";
cin >> b;
cout << "Input dx:";
cin >> dx;
if ((a > b) || (dx < 0))
{
cout << "Incorrect data" << endl;
system("pause");
return 0;
}
cout << left << setw(15) << "x" << setw(15) << "F(x)" << endl;
for (x = a; x <= b; x += dx)
{
if (x < -6)
{
f = 7 * pow(sin(x), 3) + pow(10 * x*x + 3, 0.2);
}
if ((x >= -6) && (x <= -1))
{
f = log10(1 + (abs(3 + x)) / (3 - x) + cos(x / 2));
}
if (x > -1)
{
f = - M_PI;
}
cout << setw(15) << x << setw(15) << f << endl;
}
system("pause");
return 0;
}