Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.40 KB | None | 0 0
  1. //7 задача
  2. #include <iostream>
  3. #include <cmath>
  4. using namespace std;
  5. int main()
  6. {
  7. cout << 7 +(( 5 * 3) / 2) - 4 << '\n';
  8. cout << (12 % 3) + (3 *3) – (4 /5) << '\n';
  9. cout << (4 * 5 * (5 + (6 * 2 / (6)))) ;
  10. return 0;
  11.  
  12. }
  13. // 8 задача
  14. #include <iostream>
  15. #include <cmath>
  16. #include <math.h>
  17. #define PI 3.14
  18.  
  19. using namespace std;
  20. int main()
  21. {
  22. double a, b, c, d, e, f, g, h;
  23.  
  24. a = 2.0 / 7.0;
  25. b = 1.0 / 3.0 - 0.1;
  26. c = 5.0 * 4.0 * 3.0 * 2.0;
  27. d = 74.0;
  28. e = PI;
  29. f = -34.208 * pow(10, -4);
  30. g = (int)pow(-2, 4);
  31. h = sqrt(2);
  32.  
  33. return 0;
  34. }
  35.  
  36. //9 задача
  37.  
  38. #include <iostream>
  39. #include <cmath>
  40. #include <math.h>
  41.  
  42. using namespace std;
  43.  
  44. int main() {
  45.  
  46. double a = 1;
  47. double b = 2;
  48. double c = 3;
  49. double d = 4;
  50. double x = 5;
  51. double e = 6;
  52. double y = 7;
  53.  
  54. double exampleOne = pow(a, 2) + pow(b, 2) + pow(c, 2);
  55. double exampleTwo = (a + b) / (c + d);
  56. double exampleThree = ((a + b) / c) * d;
  57. double exampleFour = (a + b) / (c * d);
  58. double exampleFive = (1 + (2 * 1) + (3 * 2 * 1)) / (1 + (1 / (2 * 1) + (1 / (3 * 2 * 1))));
  59. double exampleSix = (sqrt(2) + sqrt(3) + sqrt(4)) / (sqrt(5) + sqrt(6) + sqrt(7));
  60. double exampleSeven = sin(x) + cos(x) - (pow(tan(x) + (1 / (tan(x))), 3) / log(2 + pow(x, 4)));
  61. double exampleEight = log(5) / log(2) + log(7) / log(3) + log(9) / log(5);
  62. double exampleNinth = pow(log(0) * abs(x) + pow(e, x - 1.0), 3.0) / log(2.0 + pow(e, (x + y) / 2));
  63.  
  64. cout << exampleOne << endl;
  65. cout << exampleTwo << endl;
  66. cout << exampleThree << endl;
  67. cout << exampleFour<< endl;
  68. cout << exampleFive << endl;
  69. cout << exampleSix << endl;
  70. cout << exampleSeven << endl;
  71. cout << exampleEight << endl;
  72. cout << exampleNine << endl;
  73. }
  74.  
  75. 10 задача
  76.  
  77. //a
  78. #include <iostream>
  79. #include <cmath>
  80. #include <math.h>
  81.  
  82. using namespace std;
  83.  
  84.  
  85. int main()
  86. {
  87.  
  88. int a;
  89. cin >> a;
  90.  
  91. bool isDevidable = true;
  92. bool isNot = false;
  93.  
  94. if (a % 3 == 0 && a % 5 == 0 || a % 2 == 0 && a % 7 == 0)
  95. {
  96. cout << isDevidable << endl;
  97. }
  98. else
  99. {
  100. cout << isNot << endl;
  101. }
  102.  
  103. return 0;
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113. }
  114. //й
  115. #include <iostream>
  116. #include <cmath>
  117. #include <math.h>
  118.  
  119. using namespace std;
  120.  
  121.  
  122. int main()
  123. {
  124.  
  125. //й
  126. int a, b, c;
  127. cin >> a;
  128. cin >> b;
  129. cin >> c;
  130.  
  131. bool Positive = true;
  132. bool Negative = false;
  133.  
  134. if (a > 0 && b > 0 && c > 0)
  135. {
  136. cout << Positive << endl;
  137.  
  138. }
  139. else
  140. {
  141. cout << Negative << endl;
  142. }
  143.  
  144. return 0;
  145. }
  146.  
  147. 11 задача
  148.  
  149. #include <iostream>
  150. using namespace std;
  151.  
  152. int main() {
  153. float radius, area_circle;
  154.  
  155.  
  156. cout << "Enter the radius of circle: ";
  157. cin >> radius;
  158.  
  159. area_circle = 3.14 * radius * radius;
  160. cout << "Area of circle: " << area_circle << endl;
  161.  
  162. return 0;
  163. }
  164.  
  165. 12 задача
  166.  
  167. #include <iostream>
  168. #include <math.h>
  169. using namespace std;
  170.  
  171. int main() {
  172. float a, peri, area;
  173. cout << "Enter value of a : ";
  174. cin >> a;
  175.  
  176. peri = a * 3;
  177. cout << "Perimeter of Triangle : " << peri << endl;
  178.  
  179. area = (pow(a, 2) * sqrt(3)) / 4;
  180. cout << "The area of the triangle is: " << area<< endl;
  181.  
  182. return 0;
  183. }
  184.  
  185. 13 задача
  186.  
  187. #include <iostream>
  188. #include <cmath>
  189. #include <math.h>
  190. #define PI 3.14
  191.  
  192. using namespace std;
  193.  
  194. int main()
  195. {
  196. double a, b, c;
  197. double r, C, S, p;
  198.  
  199. double Xa = 1;
  200. double Xb = 2;
  201. double Xc = 3;
  202. double Ya = 1;
  203. double Yb = 2;
  204. double Yc = 3;
  205.  
  206. c = sqrt((pow(Xa, 2) - (2 * Xa * Xb) + pow(Xb, 2)) + (pow(Ya, 2) - (2 * Ya * Yb) + pow(Yb, 2)));
  207. b = sqrt((pow(Xc, 2) - (2 * Xa * Xc) + pow(Xa, 2)) + (pow(Ya, 2) - (2 * Ya * Yc) + pow(Yc, 2)));
  208. a = sqrt((pow(Xc, 2) - (2 * Xc * Xb) + pow(Xb, 2)) + (pow(Yc, 2) - (2 * Yc * Yb) + pow(Yb, 2)));
  209.  
  210. p = (a + b + c) / 2;
  211.  
  212. S = sqrt(p * (p - a) * (p - b) * (p - c));
  213. r = (a * b * c) / (4 * S);
  214.  
  215. C = 2 * PI * r;
  216. S = PI * pow(r, 2);
  217.  
  218. return 0;
  219. }
  220.  
  221. \\14 задача а
  222. #include <iostream>
  223. #include <cmath>
  224. #include <math.h>
  225.  
  226. int main()
  227. {
  228. double a, b, c, V, B, p;
  229. double h = 5;
  230. double Xa = 1;
  231. double Ya = 1;
  232. double Xb = 2;
  233. double Yb = 2;
  234. double Xc = 3;
  235. double Yc = 3;
  236.  
  237. c = sqrt((pow(Xa, 2) - (2 * Xa * Xb) + pow(Xb, 2)) + (pow(Ya, 2) - (2 * Ya * Yb) + pow(Yb, 2)));
  238. b = sqrt((pow(Xc, 2) - (2 * Xa * Xc) + pow(Xa, 2)) + (pow(Ya, 2) - (2 * Ya * Yc) + pow(Yc, 2)));
  239. a = sqrt((pow(Xc, 2) - (2 * Xc * Xb) + pow(Xb, 2)) + (pow(Yc, 2) - (2 * Yc * Yb) + pow(Yb, 2)));
  240.  
  241. p = (a + b + c) / 2;
  242. B = sqrt(p * (p - a) * (p - b) * (p - c));
  243.  
  244. V = h * B;
  245.  
  246.  
  247. return 0;
  248. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement