. , 쳭 (10 - 15) . , : 1 = 0.068 = 0.038378 ;
.1 ˳
#include <iostream>
#include <conio.h>
using namespace std;
int main() {
double begin, h, count, gram(0.68), drahm(0.038378);
cout << "Vvedit pochatok: ";
cin >> begin;
cout << "Vvedit krok: ";
cin >> h;
cout << "Vvedit kilkist: ";
cin >> count;
cout << "---------------------------------\n";
cout << "| Gran\t| Gram\t| Drahm\t\t|\n";
cout << "---------------------------------\n";
for (double i(begin); i < count; i += h) {
cout << "| " << i << "\t| " << i*gram << "\t| " << i*drahm << "\t|\n";
cout << "---------------------------------\n";
}
_getch();
return 0;
}
.2
z : Z = ( + b)2;
- , k - . f . , a, b, z.
.1 ˳
#include <iostream>
#include <conio.h>
using namespace std;
int main() {
double a(0), b(0), z(0);
for (int i(3); i < 8; i++) {
a += abs(cos(i) / 2.7) + 9.1 * sin(1.2 * i + 1);
}
for (int i(3); i < 11; i++) {
b += abs(cos(i) / 2.7) + 9.1 * sin(1.2 * i + 1);
}
z = pow(a + b, 2);
cout << "Variant = " << 3;
cout << "\nA = " << a;
cout << "\nB = " << b;
cout << "\nZ = " << z;
_getch();
return 0;
}
.2
- , - (0; 1) = 0,001. ?
.1 ˳
#include <iostream>
#include <conio.h>
using namespace std;
int main() {
int kf(0), k(1), x(0);
double ak(0), S(0);
cout << "Vvedit X: ";
cin >> x;
cout << "\nObchuslennja:\n";
|
|
do
{
for (int i(1); i <= k; i++)
kf += i;
ak = pow(-1, k)* (abs(cos(x) / 2.7) + 9.1 * sin(1.2 * x + 1) * pow(x, k)) / kf;
cout << ak << endl;
k++;
S += ak;
} while (ak > 0.001);
cout << "\nSuma = " << S;
_getch();
return 0;
}
.2
[0; ] h = 0., . ' .