Skip to content

Instantly share code, notes, and snippets.

@sampletext32
Last active April 26, 2020 20:09
Show Gist options
  • Save sampletext32/42be342238465f4d46945100e51ef5bc to your computer and use it in GitHub Desktop.
Save sampletext32/42be342238465f4d46945100e51ef5bc to your computer and use it in GitHub Desktop.
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
setlocale(LC_ALL, "russian");
cout << "Автор: Моисеева Наталия\n";
cout << "Программа для вычисления функции" << endl;
//Установка точности вывода
cout << setprecision(2) << setiosflags(ios::fixed);
for (double x = -1; x <= 1; x += 0.1)
{
double result = 1;
int t = 2;
for (int i = 1; i <= 8; i++)
{
result *= (x - t) / (x - (t - 1));
t *= 2;
}
cout << "f(" << x << ") = " << result << "\n";
}
system("pause");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment