Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <iostream>
- #include <math.h>
- #include <locale.h>
- int main(void)
- {
- setlocale(LC_ALL, "Ukr");
- const double K = 5.498, L = 0.995, M = 3.14;
- double x, y, a, b;
- printf("\t+------------------|------------------|------------------|------------------+\n");
- printf("\t|\ta = \t\t b = \t\tx = \t\t y = \t |\n");
- printf("\t+------------------|------------------|------------------|------------------+\n");
- for (int i = 0; i < 3; i++)
- {
- if (i == 0)
- {
- x = 3.47;
- }
- else if (i == 1)
- {
- x = 0.249;
- }
- else
- {
- x = -0.249;
- }
- if (x <= 0)
- {
- a = K;
- b = NULL;
- }
- else
- {
- a = (K - (pow(x, 1. / 3) / 4.0));
- b = L + tan(log(x)) + 2 * M;
- }
- if (a >= b)
- {
- y = log(a - b);
- }
- else
- {
- y = log(b - a);
- }
- printf("\t| %8.2lf\t\t%8.2lf\t %8.2lf\t %8.2lf\t |\n", a, b, x, y);
- }
- printf("\t+------------------|------------------|------------------|------------------+\n");
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement