Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #define _USE_MATH_DEFINES
- #include <stdio.h>
- #include <stdlib.h>
- #include <conio.h>
- #include <locale.h>
- #include <Windows.h>
- #include <string.h>
- #include <math.h>
- struct PAIR
- {
- double X;
- double Y;
- void operator()(double d1, double d2)
- {
- X = d1;
- Y = d2;
- }
- };
- int main()
- {
- setlocale(LC_ALL, "");
- SetConsoleCP(1251); SetConsoleOutputCP(1251);
- double W, Q, P, a(12.4), b(3.62), x;
- PAIR M1, M2;
- M1(8.21, -8.1);
- M2(2.14, 15.81);
- printf("x = ");
- scanf("%f", &x);
- getchar();
- Q = 6.28 + sin(x) - (a*b) / (a + b);
- if (sqrt(pow(fabs(M2.X-M1.X),2)+pow(fabs(M2.Y-M1.Y),2))==0)
- {
- W = Q;
- printf("W = Q = %f", W);
- _getch();
- }
- else
- {
- P = Q / 31.0;
- printf("P = %f", P);
- _getch();
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment