Advertisement
medajibka

2.2

Apr 18th, 2022
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5. double x;
  6. // int a, b, c;
  7.  
  8. void input() {
  9.     cout << "Enter x: ";
  10.     cin >> x;
  11. //    cout << "Enter a: ";
  12. //    cin >> a;
  13. //    cout << "Enter b: ";
  14. //    cin >> b;
  15. //    cout << "Enter c: ";
  16. //    cin >> c;
  17. }
  18.  
  19. double volumeTetrahedron(const double x) {
  20.     return (x * x * x * sqrt(2.0)) / 12;
  21. }
  22.  
  23. int main() {
  24.  
  25.     input();
  26.  
  27. //    while (b < a) {
  28. //        cout << "Input range again:\n";
  29. //        input();
  30. //    }
  31.  
  32.     cout << "Result = " << volumeTetrahedron(x);
  33.  
  34.     return 0;
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement