C++——半球面積

 

 

代碼以下:ios

 1 #include <iostream>
 2 #include <iomanip>
 3 using namespace std;
 4 int main()
 5 {
 6     double d=0.3,pi=3.14,s;
 7     s=2*pi*(d/2)*(d/2);
 8     cout<<fixed<<setprecision(5)<<s<<endl;
 9     return 0;
10 }
相關文章
相關標籤/搜索