initial
This commit is contained in:
commit
2802401eee
79 changed files with 2650 additions and 0 deletions
20
1sem/programming basics/z5/13.cpp
Normal file
20
1sem/programming basics/z5/13.cpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// pb_z5_13.cpp
|
||||
// Горбацевич Андрей
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
double ai(int);
|
||||
|
||||
int main() {
|
||||
int N;
|
||||
cout << "N >>>";
|
||||
cin >> N;
|
||||
cout << "S= " << ai(N);
|
||||
}
|
||||
|
||||
double ai(int N) {
|
||||
double out = 0;
|
||||
for (int i = 1; i <= N; i++)
|
||||
out += (float)i/((float)i+1.f);
|
||||
return out;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue