Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #define _USE_MATH_DEFINES
  4. #include <math.h>
  5. #include <cstdlib>
  6.  
  7. void task8() {
  8. int x, y;
  9. std::cin >> x >> y;
  10. std::cout << pow(x, y);
  11. }
  12.  
  13. void task9() {
  14. double num;
  15. std::cin >> num;
  16. double a, b;
  17. a = num * num;
  18. b = a * a;
  19. b = b * b;
  20. std::cout << a * b;
  21. }
  22.  
  23. void task10() {
  24. int n;
  25. std::cin >> n;
  26. std::cout << 2 + rand() % (n - 3);
  27. }
  28.  
  29. void task11() {
  30. int a, b;
  31. std::cin >> a >> b;
  32. std::cout << a + rand() % (b - a + 1) << std::endl << a + rand() % (b - a + 1) << std::endl << a + rand() % (b - a + 1);
  33. }
  34.  
  35. void task12() {
  36. int a, b;
  37. std::cin >> a >> b;
  38. double f = (double)rand() / RAND_MAX;
  39. std::cout << a + f * (b - a);
  40. }
  41.  
  42. void task14() {
  43. double r;
  44. std::cin >> r;
  45. std::cout << "S: " << M_PI * pow(r, 2) << "\nP: " << 2 * M_PI * r;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement