Advertisement
Guest User

2.1

a guest
Sep 22nd, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include "pch.h"
  2. #include <iostream>
  3. #define _USE_MATH_DEFINES
  4. #include <math.h>
  5. using namespace std;
  6. const double PI = 3.1415926535897932384626433832795;
  7. int main()
  8. {
  9. setlocale(LC_ALL, "Rus");
  10. double P, S, V, R, r, h, l;
  11. cout << "Введите R\n";
  12. cin >> R;
  13. cout << "Введите r\n";
  14. cin >> r;
  15. cout << "Введите l\n";
  16. cin >> l;
  17. cout << "Ведите h\n";
  18. cin >> h;
  19. if ((R == 0) || (r == 0) || (l == 0)) { cout << "Введены не правильные значения переменных\n"; }
  20. else {
  21. V = (PI*h*((R*R) + (R*r) + (r*r)));
  22. S = (PI*((R*R) + (R + r)*l + (r*r)));
  23. cout << "V=" << V << " S=" << S;
  24. }
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement