Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #include <conio.h>
- #include <stdlib.h>
- enum enter_forms
- {
- Commercial_organization,
- Economic_partnership,
- Full_the_partnership,
- The_partnership_faith,
- SLL,
- ALC,
- Unitary_enterprise
- };
- struct square_of_triangle
- {
- int x1, x2, x3, y1, y2, y3;
- };
- union
- {
- unsigned a;
- struct
- {
- unsigned ready: 1;
- unsigned little_toner: 1;
- unsigned damaged_drum: 1;
- unsigned no_paper: 1;
- } bytes;
- }task3;
- int main()
- {
- enum enter_forms task1;
- task1 = SLL;
- printf("%d\n\n", task1);
- struct square_of_triangle S;
- float a, b, c, p, task2;
- S.x1 = 6;
- S.x2 = -2;
- S.x3 = 5;
- S.y1 = 5;
- S.y2 = 5;
- S.y3 = 9;
- a = sqrtf(pow((S.x1 - S.x2), 2) + pow((S.y1 - S.y2), 2));
- b = sqrtf(pow((S.x2 - S.x3), 2) + pow((S.y2 - S.y3), 2));
- c = sqrtf(pow((S.x3 - S.x1), 2) + pow((S.y3 - S.y1), 2));
- p = (a + b + c) / 2;
- task2 = sqrtf((p - a) * (p - b) * (p - c) * p);
- printf("%f\n\n", task2);
- scanf("%x", &task3.a);
- printf("%d %d %d %d", task3.bytes.ready, task3.bytes.little_toner,
- task3.bytes.damaged_drum, task3.bytes.no_paper);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement