#include <iostream>
#include <windows.h>
#include <clocale>
#include <cmath>
#include <iomanip>
using namespace std;
int main() {
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
setlocale(LC_ALL, "Russian");
double result = 1;
for (int i = 1; i <= 9; i++) {
result += (pow(3, i) - pow(2, i)) / i;
}
cout << fixed << setprecision(6);
cout << "Результат = " << result << endl;
return 0;
}
1. Группа операторов, повторяющихся в цикле, называется телом цикла.
2. Параметр цикла for может изменяться с шагом +1 или -1.
3. Параметр цикла for может иметь целочисленный тип данных (int, char и др.).