#include <iostream>
#include <iomanip>
using namespace std;
double F (double x, double E, int &n)
{
double s, r, x0;
x /= 3.0;
for (n = 0, s = x0 = 1.0; ; ++n)
{
x0 *= x;
r = s + x0;
if (n && r - s < E)
return r;
s = r;
}
}
int main()
{
int i, n;
double x, E, v;
cout << ("Введите e: ");
cin >> E;
if (E < 0.00000001 || E > 0.1)
{
printf ("Следует ввести E в пределах между 0.00000001 и 0.1");
system ("pause");
return 0;
}
for (x = 0.0, i = 0; i < 10; ++i, x += 0.1)
{
v = F (x, E, n);
cout << i + 1 << "\t" << x << "\t" << v <<"\t" << n << endl;
}
return 0;
}