Помогите составить программу
Добавлено: 21 окт 2010, 21:26
Собственно, условие на картинке ниже. Вариант 5.


Код: Выделить всё
h = (b-a)/ ???????
Код: Выделить всё
#include <iostream>
#include <cmath>
#include <fstream>
#include <iomanip>
using namespace std;
const double my_pi = 3.14159265358979;
int main()
{
int m = 15;
double a = 0.0, b = (2 * my_pi)/3.0, h = (b - a)/m, x = 0.0, y = 0.0;
ofstream fout("F(x).txt", ios_base: :o ut);
for (int i = 0; i <= m; i++)
{
x = a + i * h;
y = tan(x / 2.0) + 0.5 * x;//y = F(x)
fout << setw(3) << i << setw(10) << x << setw(10) << y <<endl;
}
fout.close();
fout.clear();
return 0;
}