Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
СП КИ ЭТАП 2
#include <iostream> #include <iomanip> using namespace std; int main(){ setlocale(LC_ALL, "Russian"); int a; float sum, per; cout << "Введите количество членов полседовательности: "; cin >> a; cout << setprecision(15); cout << fixed; for(int i = 1; i<=a; i++){ per = (2*i-1)*(2*i+1); sum += (1/per); } cout << "Если считать от начала, то сумма равна: " << sum << endl; sum = 0; for(int i = a; i>=1; i--){ per = (2*i-1)*(2*i+1); sum += (1/per); } cout << "Если считать от конца, то сумма равна: " << sum << endl; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
compile-time check of existness of method of a class
Exploring the Transform Function and Operator Classes
numberOftweets
Matrix multiplication naive approach
cotton farm 0.0.1.0
test
Изволов#2
2
Karibu
cons1
stackse - search stackoverflow differently
Please log in to post a comment.