Advertisement
Md_Touhid

URI - Problem 1011 - Sphere

Apr 13th, 2020
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include<iostream>
  2. #include<iomanip> //for setprecision()
  3. #include<cmath> //for pow()
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     double pi = 3.14159, R;
  10.  
  11.     cin >> R;
  12.  
  13.     double volume = (4 * pi * pow(R, 3)) / 3;
  14.  
  15.     cout << "VOLUME = " << fixed << setprecision(3) << volume << endl;
  16.  
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement