initial
This commit is contained in:
commit
2802401eee
79 changed files with 2650 additions and 0 deletions
22
1sem/adaptation courses/5/15.cpp
Normal file
22
1sem/adaptation courses/5/15.cpp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// ac_5_15.cpp
|
||||
// Горбацевич Андрей
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
double df(int N) {
|
||||
double out = 1.;
|
||||
double os = 0.;
|
||||
for (int i = 1; i <= N; i++) {
|
||||
os += i*i;
|
||||
out *= os;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int N;
|
||||
cout << "N >>>";
|
||||
cin >> N;
|
||||
cout.setf(ios_base::fixed);
|
||||
cout << "PS= " << df(N) << endl;
|
||||
}
|
||||
32
1sem/adaptation courses/5/16.cpp
Normal file
32
1sem/adaptation courses/5/16.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
// ac_5_16.cpp
|
||||
// Горбацевич Андрей
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
using namespace std;
|
||||
|
||||
int fk(int i) {
|
||||
if ((i == 0) || (i == 1))
|
||||
return 1;
|
||||
int out = 1;
|
||||
for (int j = 2; j <= i; j++) {
|
||||
out *= j;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
double df(int N, int M) {
|
||||
double out = 0;
|
||||
int fak = fk(M);
|
||||
for (int k = M; k <= N; k++) {
|
||||
out += k*k*log(fak);
|
||||
fak *= k+1;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int N, M;
|
||||
cout << "N, M >>>";
|
||||
cin >> N >> M;
|
||||
cout << "S= " << df(N, M) << endl;
|
||||
}
|
||||
29
1sem/adaptation courses/5/17.cpp
Normal file
29
1sem/adaptation courses/5/17.cpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
// ac_5_17.cpp
|
||||
// Горбацевич Андрей
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
#include <set>
|
||||
using namespace std;
|
||||
|
||||
double df(int N) {
|
||||
double out = 0.;
|
||||
double i_ = 1;
|
||||
for (int i = 1; i <= N; i++) {
|
||||
i_ *= i;
|
||||
double j_ = 1.;
|
||||
double out_ = 1.;
|
||||
for (int j = 1; j <= i; j++) {
|
||||
j_ *= j;
|
||||
out_ *= j_/i_;
|
||||
}
|
||||
out += out_;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int N;
|
||||
cout << "N >>>";
|
||||
cin >> N;
|
||||
cout << "SP= " << df(N) << endl;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue