Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _USE_MATH_DEFINES
- #include <iostream>
- #include <string>
- #include <cmath>
- using namespace std;
- int main() {
- double radius, height;
- cin >> radius >> height;
- double volume = M_PI * radius * radius * height / 3;
- double area = M_PI * radius * (radius + sqrt(radius * radius + height * height));
- printf("volume = %.4f\narea = %.4f\n", volume, area);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement