initial
This commit is contained in:
commit
2802401eee
79 changed files with 2650 additions and 0 deletions
25
1sem/adaptation courses/4/12.cpp
Normal file
25
1sem/adaptation courses/4/12.cpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
// ac_4_12.cpp
|
||||
// Горбацевич Андрей
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
using namespace std;
|
||||
|
||||
double ak(double x, int k) {
|
||||
return sqrt(x*x + pow(sin(k*M_PI_4), 2));
|
||||
}
|
||||
|
||||
double sum(double x, int N) {
|
||||
double out = 0;
|
||||
for (int k = 1; k <= N; k++) {
|
||||
out += ak(x, k);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
int main() {
|
||||
double x;
|
||||
int N;
|
||||
cout << "x, N >>>";
|
||||
cin >> x >> N;
|
||||
cout << "S= " << sum(x, N) << endl;
|
||||
}
|
||||
30
1sem/adaptation courses/4/13.cpp
Normal file
30
1sem/adaptation courses/4/13.cpp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
// ac_4_13.cpp
|
||||
// Горбацевич Андрей
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
using namespace std;
|
||||
|
||||
double xmi(double x, int N) {
|
||||
double out = 0;
|
||||
for (int i = 1; i <= N; i++) {
|
||||
out += 1/pow(x, i);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
double xi(double x, int N) {
|
||||
double out = 1;
|
||||
for (int i = 0; i <= N; i++) {
|
||||
out *= (x - i);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
int main() {
|
||||
double x;
|
||||
int N;
|
||||
cout << "x, N >>>";
|
||||
cin >> x >> N;
|
||||
cout << "S= " << xmi(x, N) << endl;
|
||||
cout << "P= " << xi(x, N) << endl;
|
||||
}
|
||||
25
1sem/adaptation courses/4/14.cpp
Normal file
25
1sem/adaptation courses/4/14.cpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
// ac_4_14.cpp
|
||||
// Горбацевич Андрей
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
using namespace std;
|
||||
|
||||
double inline ai(int i) {
|
||||
return ((i%3 == 0)? (i / 3.) : (i / (i - 3.)));
|
||||
}
|
||||
|
||||
double sai(int i) {
|
||||
double out = 0;
|
||||
for (int k = 1; k <= i; k++) {
|
||||
auto fr = ai(k);
|
||||
out += pow(fr, 2);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int N;
|
||||
cout << "N >>>";
|
||||
cin >> N;
|
||||
cout << "S= " << sai(N) << endl;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue