Advertisement
Guest User

Untitled

a guest
Dec 16th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <conio.h>
  4. #include <stdlib.h>
  5.  
  6. enum enter_forms
  7. {
  8. Commercial_organization,
  9. Economic_partnership,
  10. Full_the_partnership,
  11. The_partnership_faith,
  12. SLL,
  13. ALC,
  14. Unitary_enterprise
  15. };
  16.  
  17. struct square_of_triangle
  18. {
  19. int x1, x2, x3, y1, y2, y3;
  20. };
  21.  
  22. union
  23. {
  24. unsigned a;
  25.  
  26. struct
  27. {
  28. unsigned ready: 1;
  29. unsigned little_toner: 1;
  30. unsigned damaged_drum: 1;
  31. unsigned no_paper: 1;
  32. } bytes;
  33. }task3;
  34.  
  35. int main()
  36. {
  37. enum enter_forms task1;
  38. task1 = SLL;
  39. printf("%d\n\n", task1);
  40.  
  41. struct square_of_triangle S;
  42. float a, b, c, p, task2;
  43. S.x1 = 6;
  44. S.x2 = -2;
  45. S.x3 = 5;
  46. S.y1 = 5;
  47. S.y2 = 5;
  48. S.y3 = 9;
  49. a = sqrtf(pow((S.x1 - S.x2), 2) + pow((S.y1 - S.y2), 2));
  50. b = sqrtf(pow((S.x2 - S.x3), 2) + pow((S.y2 - S.y3), 2));
  51. c = sqrtf(pow((S.x3 - S.x1), 2) + pow((S.y3 - S.y1), 2));
  52. p = (a + b + c) / 2;
  53. task2 = sqrtf((p - a) * (p - b) * (p - c) * p);
  54. printf("%f\n\n", task2);
  55.  
  56. scanf("%x", &task3.a);
  57. printf("%d %d %d %d", task3.bytes.ready, task3.bytes.little_toner,
  58. task3.bytes.damaged_drum, task3.bytes.no_paper);
  59.  
  60. return 0;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement