c2
This commit is contained in:
parent
0d75f30a49
commit
4744ebb565
69 changed files with 7 additions and 5 deletions
27
1sem/programming basics/04/1_60.cpp
Normal file
27
1sem/programming basics/04/1_60.cpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// pb_4_1_60.cpp
|
||||
// Горбацевич Андрей
|
||||
#include <iostream>
|
||||
#include <clocale>
|
||||
#include <cmath>
|
||||
using namespace std;
|
||||
|
||||
double f1(double x)
|
||||
{
|
||||
x = x + 3.14;
|
||||
return x;
|
||||
}
|
||||
double f2(double x)
|
||||
{
|
||||
x = sqrt(x*x + 2);
|
||||
return x;
|
||||
}
|
||||
int main()
|
||||
{
|
||||
double x;
|
||||
cout << "X=?\n";
|
||||
cin >> x;
|
||||
cout << "y=" << f1(x) + f1(x*x) + f2(x) + f2(x-1) << endl;
|
||||
}
|
||||
|
||||
// 1 11.4263
|
||||
// 2 16.4615
|
||||
31
1sem/programming basics/04/2_40.cpp
Normal file
31
1sem/programming basics/04/2_40.cpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
// pb_4_2_40.cpp
|
||||
// Горбацевич Андрей
|
||||
#include <iostream>
|
||||
#include <clocale>
|
||||
#include <cmath>
|
||||
using namespace std;
|
||||
|
||||
double f1(double x)
|
||||
{
|
||||
x = log(x*x) - 8.3e3;
|
||||
return x;
|
||||
}
|
||||
double f2(double x)
|
||||
{
|
||||
x = 1 / (cbrt(3*x) + 1);
|
||||
return x;
|
||||
}
|
||||
int main()
|
||||
{
|
||||
double x;
|
||||
cout << "X=?\n";
|
||||
cin >> x;
|
||||
if (x == 0) {
|
||||
cout << "err: x == 0" << endl;
|
||||
return 0;
|
||||
}
|
||||
cout << "y=" << f1(x) + f2(x) << endl;
|
||||
}
|
||||
|
||||
// 1 -8299.59
|
||||
// 2 -8298.26
|
||||
Loading…
Add table
Add a link
Reference in a new issue