Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- #define _USE_MATH_DEFINES
- #include <math.h>
- using namespace std;
- const double PI = 3.1415926535897932384626433832795;
- int main()
- {
- setlocale(LC_ALL, "Rus");
- double P, S, V, R, r, h, l;
- cout << "Введите R\n";
- cin >> R;
- cout << "Введите r\n";
- cin >> r;
- cout << "Введите l\n";
- cin >> l;
- cout << "Ведите h\n";
- cin >> h;
- if ((R == 0) || (r == 0) || (l == 0)) { cout << "Введены не правильные значения переменных\n"; }
- else {
- V = (PI*h*((R*R) + (R*r) + (r*r)));
- S = (PI*((R*R) + (R + r)*l + (r*r)));
- cout << "V=" << V << " S=" << S;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement